Joins and Clarification

Hello,

I have a clarification on using joins in N1QL. I have two buckets and the key is different on both the buckets.

So for example, i have a bucket A and bucket B. In A i have a key has id and in B i have a key as UniqueId.
So i need to join but i am not able to retreive any result by using ON Keys and USE Keys.

Please help here.

can you post your N1QL here?

try this one

SELECT A.*,B.* 
  FROM A
  JOIN B ON KEY B.UniqueId FOR A
WHERE meta(A).id="some_id_of_A"

And don’t forget add index for B.UniqueId if you want to use ON KEY ... FOR ... ,such as

CREATE INDEX `idx_UniqueId_B` ON `B`(UniqueId) USING GSI;