N1QL Joins on Document Fields

Document keys are immutable.

Both the simple JOIN … ON KEYS …
and the more nuanced JOIN … ON KEY … FOR …

require one primary key and one foreign key. The only difference is that the first form requires that the left hand term provide a foreign key to the right hand term, while second form requires that the right hand term provide a foreign key to (one of) the preceding left hand term. That is the only difference.

I would recommend that you model your data first (including external keys / ids), try out your JOINs using the Query Workbench or cbq shell, and then continue with your app and Ottoman.

Gerald