Sub document operations using .net SDK ( c#)

@krishnaa

The sub-doc API can only delete items in an array by index. If you need to delete by Id, you have a few options.

  1. Get the whole document and set it back
  2. Get the whole document, determine the index, and then use that for a sub-doc mutation
  3. Get the whole array using a sub-doc get, remove the item, and set the whole array back using a sub-doc mutation
  4. Get the whole array using a sub-doc get, determine the index, and then use that for a sub-doc mutation
  5. Use a N1QL UPDATE query

For 1-4, you’ll probably want to use the CAS value to provide isolation.