N1QL
-
This is Couchbase’s query language. With N1QL you can execute SQL
queries(SELECT, FROM) and get results from Couchbase DB(which stores
data in Json format)
Additional Operators
-
Data in Couchbase Server is stored in the form of documents, not rows or
columns, so db wuold need additional operators to access nested
elements.
| Operator | Description |
|---|---|
| . Dot operator [] operator |
‘.’ operator is used to refer to children ‘[]’ refers to an element in an array
|
| LIKE |
String matching can be accomplished using the LIKE operator in the
WHERE clause. % is a wildcard that matches zero or more characters _ is a wildcard that matches exactly one character.
|
| ANY/EVERY - SATISFIES |
ANY clause allows us to assign a name to an element in the array
that we are searching through. SATISFIES keyword is used to specify the filter condition.
|
| AND |
Combining multiple conditions with AND
|
Query examples
| Query | Result |
|---|---|
|
|