Hi,
suppose to have this document representing a trip:
{
"_id": "trip_id",
"type": "Trip",
...
}
and these documents representing the tolls during a trip:
{
"_id": "toll_id",
"trip_id": "trip_id",
...
}
so it’s a one-to-many relationship.
I’d like to execute a join like this, and i saw in this topic
to use the for
key:
SELECT tolls
FROM bucket_name AS b
USE KEYS 'trip_id'
JOIN bucket_name AS tolls
ON KEYS tolls.trip_id FOR b
but console shows me:
syntax error - at FOR
If i remove the for
, i end up with:
Ambiguous reference to field tolls.
What am i doing wrong?
The final result should be an array of tolls having the selected trip_id
Thanks in advance