Browse Source

cannot return result directly fix it

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

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

@ -53,7 +53,8 @@ class ArangoDBIntegration {
try { try {
const result = await this.client.query(query.sql) const result = await this.client.query(query.sql)
let rl = [] 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,7 +70,8 @@ class ArangoDBIntegration {
aql`INSERT ${query.json} INTO ${clc} LET n = NEW RETURN NEW` aql`INSERT ${query.json} INTO ${clc} LET n = NEW RETURN NEW`
) )
let rl = [] 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