Joining buckets on keys

So I am trying to find out how determine what key following join will be on
Is it on the Doc.Always or we can join based on other values as well
select from
select from
(select meta().id as id from travel-sample where type = ‘route’ order by to_number(meta().id) ) t0
offset 20 limit 10
) t1
INNER JOIN travel-sample t2 on keys

it can be other values , in fact

which means each qualified document from the left hand side (LHS) of the JOIN operator is required to produce primary keys of documents on the right hand side (RHS). such as

INNER JOIN travel-sample t2 on keys ( == META(t2).id)

so can be any other keys that is foreign key.