1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

prettify code

This commit is contained in:
sovlookup 2021-01-28 23:08:53 +08:00
parent 3f1797acd6
commit a2bafdc814

View file

@ -52,9 +52,7 @@ class ArangoDBIntegration {
async read(query) {
try {
const result = await this.client.query(query.sql)
let rl = []
await result.forEach(r => rl.push(r))
return rl
return result.all()
} catch (err) {
console.error("Error querying arangodb", err.message)
throw err
@ -67,11 +65,9 @@ class ArangoDBIntegration {
const clc = this.client.collection(this.config.collection)
try {
const result = await this.client.query(
aql`INSERT ${query.json} INTO ${clc} LET n = NEW RETURN NEW`
aql`INSERT ${query.json} INTO ${clc} RETURN NEW`
)
let rl = []
await result.forEach(r => rl.push(r))
return rl
return result.all()
} catch (err) {
console.error("Error querying arangodb", err.message)
throw err