Browse Source

add arangodb integration

gh-pages
sovlookup 6 years ago
parent
commit
0b8987f6a1
  1. 8
      packages/server/src/integrations/arangodb.js

8
packages/server/src/integrations/arangodb.js

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

Loading…
Cancel
Save