Hello I'm using arangojs, created a database, added data to the collection beusers
.
Now I want to read the added data. In ArangoDB I can do so using the query
FOR user IN beusers
FILTER user.password == '3670747394' && user.email == '3817128089'
RETURN user
Doing
const user = await usedDB.parse(aql`
FOR user IN ${usersCol.name}
FILTER user.password == ${hashedPassword} && user.email == ${hashedEmail}
RETURN user
`)
console.log(user)
in arangojs I get
{
error: false,
code: 200,
parsed: true,
collections: [],
bindVars: [ 'value2', 'value0', 'value1' ],
ast: [ { type: 'root', subNodes: [Array] } ]
}
The example in the readme got me only so far.
What am I missing? How can I read the data?
You want to use
Database.query()
to get a cursor (ArrayCursor
) and then you want to return the value in the cursor's result list (for example usingArrayCursor.all()
).So the code would look like this: