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?
I’ve put the Expression.i( because my ids look a bit more complex e.g. dsrecord::oid2:default:e96876b2e6e711e6b8f3e4ce8f208bf2 so I guess I need to escape special characters.
I wish there will be native support for removing simple strings from a set in the future.
From reading this sourcecode it looks like operations like setRemove under the hood still fetch the whole document.
I would prefer having Couchbase Server handle this internally more efficiently without the extra roundtrip.