Sub-Document operations with empty key in path

I use Sub-Document operations to patch documents in my couchbase 5.0.1.

Let’s consider that we want to update an existing document with following json:

	"prop1": {
		"": { 
			"prop2": "some value"

Please notice that there is a empty string as a key.

If I update document using path “prop1”:

asyncBucket.mutateIn(id).upsertDocument(true) //
				.upsert("prop1", mapWithEmptyKey)

then it finishes successfully so the key with empty string is stored properly to database.

But if I try to use empty key in path then I receive error SUBDOC_PATH_INVALID. Examples of paths:


It is a bit inconsistent.

Is it possible to use Sub-Document api with “empty” keys? Is it a special notation for that case (other than putting value in double-backticks (``))?

Empty key is not valid JSON.

According to standard ECMA-404 (, the empty string is a valid json value.

any update on that issue?

It seems it is possible to create JSON document using regular API, but sub-doc API is forbidding updating keys with empty String as key in path.

In case of usage sub-doc API

asyncBucket.mutateIn('documentId').upsertDocument(true) //
				.upsert("prop1.``.anotherProperty", "someValue")

I’m receiving

Caused by: Path prop1.``.anotherProperty ends in an array index in documentId, expected dictionary

When creating document using


I’m able to save values with empty keys

It might be limitation at present.
As far as N1QL is concern you can track via MB-46420