Hi Im running couchabse server 7.1.3
docker container and trying to use the 3.3.4 couchbase java sdk
version. I am facing an issue while performing subdocument mutation using the upsert
command.
The issue I am facing is when I use the collection.mutateIn()
method to perform a subdocument mutation using the upsert
command, I am expecting to get the result of the operation as a MutateInResult object. when I try to use the MutateInResult.contentAs(0, String.class)
to see the response I get the Index 0 is invalid
error. I see that the operation as in is successful in the DB, I can see the desired json path has the updated value.
P.S: I only have a single mutation to perform which is the upsert command.
can someone please help if I am missing something here?
A
MutateInResult
only has content for the result ofincrement
anddecrement
mutations. In those two cases, the content is the new counter value, which you can access usingresult.contentAs(index, Long.class)
.For all other types of subdocument mutations, the result does not include any content.