Java SDK: v2.4.1
My use-case:
I want to maintain a list of children-ids on each master. Each child also has a masterId and adds itself to the master in our code using arrayAddUnique.
Now I also want to remove the child-id from the master e.g. when the child is removed or assigned to a different master.
Code:
I am currently adding to an array using SubdocumentAPI via:
bucket.mutateIn("masterId1").arrayAddUnique("childrenids","childId1", true).execute();
Is it possible to remove from an array too? Something like:
bucket.mutateIn("masterId1").arrayRemove("childrenids","childId1", true).execute();
Haven’t found a method ‘arrayRemove’ yet, although on this site it says:
Mutating Array Fields
The sub-document API supports a similar set of commands on arrays as on dictionaries. It also adds the ability to push items to the beginning or the end of an array, without having to explicitly check the current length of the array.
…
Deleting an existing array element (reducing the array size by 1) using remove.
Does this ‘remove’ method exist or is it called differently in the Java SDK?