Nested operators

Fields:

expression . ( identifier | escaped identifier [ i ])

Elements:

expression [ expression ]

Array Slicing:

expression [expression : [ expression ] ]

Two special operators are needed to access the data because Couchbase documents containing the data can have nested elements and embedded arrays.
The ‘.’ operator is used to refer to children (one level down), and the ‘[ ]’ is used to refer to an element in an array.
You can use a combination of these operators to access nested data at any depth in a document.

Field selection

The ‘.’ operator is used to refer to children, that is, one level down in a nested expression.

Nested expressions support using the dot (.) operator to access fields nested inside of other objects.
The form .[expression] is used to access an object field named by evaluating the expression contained in the brackets.

field-expression

expression . ( identifier | escaped identifier [ i ])

By default, field names are case sensitive.
To access a field case-insensitively, include the trailing i.

Element selection

Nested expressions also support using the bracket notation ([position]) to access elements inside an array.
The [ ] operator is used to refer to an element in an array.
Negative positions are counted backwards from the end of the array.