简体   繁体   中英

How to execute generic query in ArangoJs?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM