1
votes

Collection named "PatternInfo" contains following documents: 1. { "pattern": "abcde*fgh"} 2. { "pattern": "test*new" } 3. { "pattern": "abc%^def" }

Whenever the following query is run to filter patterns containing '*' empty results is returned. for doc in PatternInfo filter like(doc.pattern, "%test*n%", false) return doc

I have even tried escaping '*', although the ArangoDB documentation for LIKE specifies only '%' and '_' to be escaped.

Is something wrong with the query or ArangoDB itself?

1

1 Answers

0
votes

There seems to be a bug in the C++ implementation of LIKE().

The V8 implementation produces the expected results in my test:

for doc in PatternInfo
filter noopt(v8(like(doc.pattern, "%test*n%", false)))
return doc

It matches 2. { "pattern": "test*new" } correctly.

I created a bug report on your behalf: https://github.com/arangodb/arangodb/issues/4919