Does the SDK have an option to update an Array Document?

Hi,

looked thru the docs and was wondering if there is a way to update a doc in array directly. I only found Append, Prepend and Insert and for now my work around is

 bucket
  .mutateIn(docID)
  .remove(path + "[" +index +"]")
  .arrayInsert(path +"[" +index +"]", doc)
  .execute((err, result) => {}

which works but i doubt ideal as it causes 2 operations in my case actually 3 on the doc as i have to find
the index for this Doc in array before i can delete and insert again

Hey @makeawish,

You should be able to perform an replace against the array index as you have done (path + '[' + index + ']'). This should have the same effect as you have encoded as multiple ops. Note that doing multiple operations won’t have a substantial effect due to the fact that it is executed simultaneously on the server side.

Cheers, Brett