-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error parsing query on select from list of record Ids (v3) #376
Comments
Note that this may be related to #380 ? Unsure if select from list of records is treated the same as filtering against a list of records |
Hi @creisle i've checked this syntax is not supported
if you want to use parameters in the target you have to use one 1 param like this
let me know if this helps Thanks |
@wolf4ood I get a different error when i try that const result = await db.query(
'SELECT * FROM :people',
{params: {people: [bob['@rid'], alice['@rid']]}}
).all(); error message { OrientDB.RequestError: Cannot use colleciton as target: [null, null]
DB name="test_select_from_list"
at child.Operation.parseError (/home/creisle/git/knowledgebase/knowledgebase_api/node_modules/orientjs/lib/client/network/protocol37/operation.js:1224:13)
at child.Operation.consume (/home/creisle/git/knowledgebase/knowledgebase_api/node_modules/orientjs/lib/client/network/protocol37/operation.js:566:35)
at ONetworkConnection.Connection.process (/home/creisle/git/knowledgebase/knowledgebase_api/node_modules/orientjs/lib/client/network/conn.js:462:17)
at ONetworkConnection.Connection.handleSocketData (/home/creisle/git/knowledgebase/knowledgebase_api/node_modules/orientjs/lib/client/network/conn.js:344:20)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
name: 'OrientDB.RequestError',
message:
'Cannot use colleciton as target: [null, null]\r\n\tDB name="test_select_from_list"',
data: {},
isMVCC: [Function],
isTokenException: [Function],
previous: [],
code: 5,
identifier: 0,
id: 1,
type:
'com.orientechnologies.orient.core.exception.OCommandExecutionException',
hasMore: 0 } I can select from a collection when not using parameters (ex. if I sub them in directly) const result = await db.query(`SELECT * FROM [${bob['@rid']}, ${alice['@rid']}]`).all(); |
Version info
orientdb version: 3.0.14
orientjs version: 3.0.5
nodejs version: v10.13.0
Expected Behaviour
The same query previously worked in v2.2.X and works when done in the orientdb console but throws an error when using orientjs v3+
Observed Behaviour
throws the following error message
Min Reproducible Example
The text was updated successfully, but these errors were encountered: