Hi,

I'm not sure if I'm doing something wrong or if there's a problem with the 
transaction API, but I'm having trouble with requests that filter by 
strings that have backslashes ('\') in them.

Let's say I have a TestCollection containing 2 objects:

[
{"_id":"TestCollection/39151872291","_key":"39151872291","_rev":"39200041251","filePath":"C:\\temp\\a.txt"},
{"_id":"TestCollection/39156328739","_key":"39156328739","_rev":"39157180707","filePath":"C:\\temp\\b.txt"}
]

And I'm trying to run a query inside a transaction, that filters them out 
based on the filePath.

A query to the transaction API using the following body returns an empty 
list:

{
"action": "function () { var db = require('@arangodb').db; return 
db._query(\"FOR node IN TestCollection FILTER node.filePath == 
'C:\\temp\\a.txt' RETURN node\").toArray(); }",
"collections": {
"read": ["TestCollection"]
}
}

While a query with this body returns a list with both objects

{
"action": "function () { var db = require('@arangodb').db; return 
db._query(\"FOR node IN TestCollection FILTER node.filePath != 
'C:\\temp\\a.txt' RETURN node\").toArray(); }",
"collections": {
"read": ["TestCollection"]
}
}

I obviously want the first query to return a single object, since the 
filepath should match the first object. It seems to be an escaping problem, 
but I can't get it to work no matter what I try.

If I add a third object, with a filepath without backslashes, I can filter 
on it just fine.

Am I doing anything wrong?

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to