Join with two diffrent keys

I want to join two documents, both documents have a reference of a third document means I want to join with a key that is not meta().id.

comman key in both doc (User,Agent)

 "clients": [
          "id": "1b0a646d"
select * from data c  join data a
on =
where a.type_=''Agent' and c.type_='User'

it’s not working.
Anyother good way

clients is array. Checkout Example 12, 13