SOLVED

For each document I pre-compute an array of possible prefixes and store it 
as attribute _all_paths - in this case:

doc._all_paths = [
'/path',
'/path/to',
'/path/to/my',
'/path/to/my/content'
]

Then I can query this field using the IN operator:
for doc in mycollection
    FILTER '/some/path' in doc._all_paths

Andreas

On Wednesday, May 15, 2019 at 11:59:18 AM UTC+2, Andreas Jung wrote:
>
> As part of a CMS migration we store all content as JSON in ArangoDB. 
> Content objects have to path properties
>
> _path = '/path/to/my/content/foo.html'
> _path2 = ['path', 'to', 'my', 'content', 'foo.html']
>
> Basic question: what is the best way to query in AQL for all documents by 
> where _path matches a particular prefix like '/path' or 
> '/path/to/my/content'.
> I can use FILTER doc._path like '/path/%' but that's not very 
> efficient...any better idea?
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/arangodb/28533185-3cf8-464b-82ee-905e49b1bd19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to