I use MATCHES()
AQL function to search for entries in the arango database matching an example. This feature works nice for plain examples, but I cannot get it work properly with the nested features. See example:
RETURN MATCHES(
{ "a" : { "c" : 1 }, "b" : 1 },
{ "a" : { "c" : 1 } },
false
)
This returns true
, however if I try:
RETURN MATCHES(
{ "a" : { "c" : 1, "b" : 1 }},
{ "a" : { "c" : 1 } },
false
)
It returns false
!! (I expected to return true)
I have read that this is known in the Query by example
section
https://www.arangodb.com/docs/stable/data-modeling-documents-document-methods.html#query-by-example
Their solution is to use dot notation, but it does not work in AQL
Following their example:
RETURN MATCHES(
{ "a" : { "c" : 1, "b" : 1 } },
{ "a.c" : 1 },
false
)
returns false
(and I would expect to return true)
How can I then, use the MATCHES()
for nested attributes?
FYI: I use arangodb v3.5.5-1
Clarification:
I want to get a match of { "a" : { "c" : 1, "b" : 1 } }
by giving { "a" : { "c" : 1 } }
as example
I've posted the Issue in ArangoDB repository: https://github.com/arangodb/arangodb/issues/12541