Joins using N1ql


#1

Hi

How to join two documents in couchbase using N1ql Query ??
The primary key of second document is known.


#2

ANSI JOINS in 5.5 https://blog.couchbase.com/ansi-join-support-n1ql/


#3

Thanks for the reference.But while joining what is “KEYS” ? I am stucked here. any suggestion??


#4

A JOIN B ON KEYS A.f1

A.f1 expression that should point to document key in B
A.f1 can be single value (each left document joins one right side document) or Array of Values (each left side document joins n number of right side documents).

https://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/from.html

Also checkout JOIN Faster With Couchbase Index JOINs