How to execute generic query in ArangoJs?

47 views Asked by At

I need to execute the following query:

const query = `FOR u IN ${collection} FILTER ${filter} RETURN u`

so that filter variable is generated somehow by me (it is corrects, checked with Arango console)

But

db.query(query)

always returns empty cursor, and

db.query(aql`FOR u IN ${db.collection(collection)} FILTER ${filter} RETURN u`)

ignores my filter - data is not filtered.

How to execute query with arangojs with pre-generated filter?

1

There are 1 answers

0
Bogdan Timofeev On BEST ANSWER

Fix: db.query(query).all() worked