Hi,
During work with AsyncMutateInBuilder
I noticed a problem:
- when
AsyncMutateInBuilder
has setupsertDocument
flag totrue
, usage ofasyncMutateInBuilder.remove
in not possible and result in:
Caused by: com.couchbase.client.core.CouchbaseException: INVALID_ARGUMENTS
at com.couchbase.client.java.subdoc.SubdocHelper.commonSubdocErrors(SubdocHelper.java:101)
at com.couchbase.client.java.subdoc.AsyncMutateInBuilder$2$1.call(AsyncMutateInBuilder.java:1330)
at com.couchbase.client.java.subdoc.AsyncMutateInBuilder$2$1.call(AsyncMutateInBuilder.java:1276)
at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
... 18 more
Sample to reproduce:
final AsyncMutateInBuilder asyncMutateInBuilder = asyncBucket
.mutateIn(DOCUMENT_ID);
.insertDocument(true);
final SubdocOptionsBuilder optionsBuilder = SubdocOptionsBuilder.builder().createPath(true);
asyncMutateInBuilder.upsert(pathToUpsert, newValue, optionsBuilder);
asyncMutateInBuilder.remove(pathToRemove);
When I commented insertDocument
flag it is working as expected.
Unfortunately I need add and remove some fields in one run + if document doesn’t exist yet create it.
Could you take a look on it? I don’t think that it is expected behaviour upsertDocument
flag shouldn’t forbid removing some document paths.
Couchabse server version: docker couchbase:community-6.0.0
Couchbase Java SDK:
compile group: 'com.couchbase.client', name: 'java-client', version: '2.7.2'