n1ql join doesn't work


#1

hello, test doesn’t have any document field called Ptest2 bu it still giving errors

cbq> select * FROM test b JOIN test2 a ON KEYS a.Ptest2 WHERE b.Type=‘test1’ and a.type=‘test2’ ;
{
“requestID”: “85aa366c-0799-4245-9a9b-65d5d716e8a1”,
“errors”: [
{
“code”: 3000,
“msg”: “Ambiguous reference to field a.”
}
],
“status”: “fatal”,
“metrics”: {
“elapsedTime”: “1.55649ms”,
“executionTime”: “1.060408ms”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

cbq>


#2

select * FROM test2 a JOIN test b ON KEYS a.Ptest2 WHERE b.Type=‘test1’ and a.type=‘test2’ ;
works


#3

Yep. N1QL joins are left to right.