How to delete items from a sub document array?

Hi @rkunhi did you manage to find a way around this? I’m guessing that How to get the index of sub-document ?KV is also related to this. There is no way to either remove or get the index of an array element at the server (and therefore SDK) level for KV.

Your best bet is probably to do a lookupin of the array, remove the element, and then mutatein using the CAS value from the lookup to ensure that noone else modified the array in the meantime. Unforunately this is obviously two round trips rather than one.

There may be an alternative way to do this via N1QL, if so then maybe @vsr1 can assist here?