Joins using N1ql

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