How to deal with references

Hi,

I have seen this article on sub-document operations but it doesn’t fully answer my questions.

I am wondering if I can do some conditional updates with references ?

Assuming I have this data model:

{
    type: "user",
   addresses: [
          type: "adresse::shipment"
          id: "1234"
   ]
},
{
   id: 1234,
    type: "adresse::shipment",
   country: DE
}

Now, I want to update all users where country in the shipment address is DE. Can I do this in one transaction or do I have to get all ids of users via N1QL query, loop through each user and update it case by case?

Thanks,
Jan