I have collection 'Notifier'. Given the following example document of this collection:
{
"timestamp": 1413543986,
"message": "message",
"readed": {
"user_8": 0,
"user_9": 0,
"user_22": 0
},
"type": "1014574149174"
}
I try find this document with the following AQL:
FOR n IN Notifier
LET usersFound = TO_BOOL(
FOR user IN n.readed
FILTER user == 'user_8'
LIMIT 1
RETURN user
)
FILTER usersFound==true
RETURN n
I get the following error:
[1501] syntax error, unexpected FOR declaration, expecting ) near 'OR user IN n.readed FILT...' at position 3:10
How can I write this AQL correctly using LET?