I am doing partial update of a couchbase document as follows:
...
MutateInBuilder builder = bucket.mutateIn(id);
for (Map.Entry<String, Object> entry : map.entrySet())
{
builder = builder.upsert(entry.getKey(), entry.getValue());
}
builder.execute();
...
When all the values in all the upsert calls are of the same type, things work fine.
However, if some values are strings, and say others are Boolean, we are getting the exception:
com.couchbase.client.core.CouchbaseException: SUBDOC_INVALID_COMBO at com.couchbase.client.java.subdoc.SubdocHelper.commonSubdocErrors(SubdocHelper.java:100) at com.couchbase.client.java.subdoc.AsyncMutateInBuilder$2.call(AsyncMutateInBuilder.java:1094) at com.couchbase.client.java.subdoc.AsyncMutateInBuilder$2.call(AsyncMutateInBuilder.java:1052)
In the testcases for upsert, could not find any case where multiple attributes are updated.
How do we upsert a document with attributes of different types in Couchbase?
EDIT#1:
Now, things got weirder... I am getting the same exception if I update more than 16 attributes in one iteration.
From the Couchbase Sub-Document API documentation (see the Limits section):
I guess you were encountering this limitation in both cases, mixed value type and single value type.
Verified using Couchbase Java SDK version 2.3.7.