我的 Foxx 应用程序中有这样的代码:
db._query(aqlQuery`
FOR d IN FULLTEXT('api_texts', '${args.attribute}', '${args.search}')
SORT d.${args.sort_by} ${args.sort}
LIMIT ${args.skip}, ${args.limit}
RETURN d
`).toArray()
这似乎是正确的,但由于某种原因它给了我一个错误bind parameter 'value1' was not declared in the query (while parsing)
。
我试图在arangosh
......同样的错误中运行它:
arangosh [ilearn]> db._query({ "query" : "\n FOR d IN FULLTEXT('api_texts', '@value0', '@value1')\n SORT d.@value2 @value3\n LIMIT @value4, @value5\n RETURN d\n ", "bindVars" : { "value0" : "title_en", "value1" : "1", "value2" : "created_at", "value3" : "ASC", "value4" : 0, "value5" : 10 } })
JavaScript exception in file '/usr/local/Cellar/arangodb/2.8.6/share/arangodb/js/client/modules/org/arangodb/arangosh.js' at 106,13: ArangoError 1552: bind parameter 'value1' was not declared in the query (while parsing)
! throw error;
! ^
stacktrace: ArangoError: bind parameter 'value1' was not declared in the query (while parsing)
at Object.exports.checkRequestResult (/usr/local/Cellar/arangodb/2.8.6/share/arangodb/js/client/modules/org/arangodb/arangosh.js:104:21)
at ArangoStatement.execute (/usr/local/Cellar/arangodb/2.8.6/share/arangodb/js/client/modules/org/arangodb/arango-statement.js:186:12)
at ArangoDatabase._query (/usr/local/Cellar/arangodb/2.8.6/share/arangodb/js/client/modules/org/arangodb/arango-database.js:814:45)
at <shell command>:1:4
难道我做错了什么?请帮忙。谢谢!
PS: OS X 上的 Arangodb v2.8.6