This AQL returns an object I would like to use.
const keys = db._query(aql`
FOR huis IN test
FILTER huis._key in ${req.queryParams.keys}
RETURN {
'key': huis._key,
'adres': huis.adres,
'postcode': huis.postcode,
'plaats': huis.plaats
}
`);
This returns this object:
[
{
"key": "374875",
"adres": "Klaverstraat 7",
"postcode": "2197GV",
"plaats": "Leiden"
}
]
Then I would like to take the key like so:
keys[0].key
This works in JavaScript when I make a fiddle but not in Foxx.
const test = [
{
"key": "374875",
"adres": "Klaverstraat 7",
"postcode": "2197GV",
"plaats": "Leiden"
}
]
console.log(test[0].key)
374875
Why does this return 'undefined' in Foxx but the correct data in a Fiddle?