Hello,
I have created a query where I would call a list of “followers”, and for an array of them, I want to join the “user_account” type information. I have been able to retrieve the results I want, however I would like to have the META().id of the JOINed table as the key for each user below.
My current query looks like:
select users FROM (SELECT `default` m, mbrs
FROM `default`
LET mbrs = ARRAY m.name FOR m IN OBJECT_PAIRS(default.followers) END
WHERE default._type = "followers"AND
default._id = 1) as q JOIN default users
ON KEYS q.mbrs;
My documents structure:
Document Type Followers (“user_account::6::followers”):
{
"_id": 1,
"_type": "followers",
"created_at": 1472741410,
"followers": {
"user_account::1": {
"status": 0,
"created_at": 1472741410
},
"user_account::3": {
"status": 0,
"created_at": 1472741410
}
}
}
Document Type User Account (“user_account::1”):
{
"_id": 1,
"_type": "user_account",
"name": "João Carlos",
"active": 1,
"updated_at": 1472741410,
"created_at": 1472741410
}
Expected output:
{
"user_account::1": {
{
"_id": 1,
"_type": "user_account",
"name": "João Carlos",
"active": 1,
"updated_at": 1472741410,
"created_at": 1472741410
}
},
"user_account::3": {
{
"_id": 3,
"_type": "user_account",
"name": "Pedro Silva",
"active": 1,
"updated_at": 1472741410,
"created_at": 1472741410
}
}
}
Instead of “user_account::X” keys I am getting “users” as each key (obviously, as it is in the query).
What am I missing to get keys to show up as document keys?
Thanks!