From 0b8987f6a1411e61d1c95f8e52480d938bd745bf Mon Sep 17 00:00:00 2001 From: sovlookup <805408477@qq.com> Date: Thu, 28 Jan 2021 22:20:15 +0800 Subject: [PATCH] add arangodb integration --- packages/server/src/integrations/arangodb.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/server/src/integrations/arangodb.js b/packages/server/src/integrations/arangodb.js index 2b3ee1b11b..c886b6b918 100644 --- a/packages/server/src/integrations/arangodb.js +++ b/packages/server/src/integrations/arangodb.js @@ -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.forEach(r => rl.push(r)) } catch (err) { console.error("Error querying arangodb", err.message) throw err @@ -69,9 +67,7 @@ class ArangoDBIntegration { const result = await this.client.query( aql`INSERT ${query.json} INTO ${clc} LET n = NEW RETURN NEW` ) - let rl = [] - await result.forEach(r => rl.push(r)) - return rl + return result.forEach(r => rl.push(r)) } catch (err) { console.error("Error querying arangodb", err.message) throw err