From 3f1797acd673177eac3fe9bda1b3b55fdbdfc992 Mon Sep 17 00:00:00 2001 From: sovlookup <805408477@qq.com> Date: Thu, 28 Jan 2021 22:35:41 +0800 Subject: [PATCH] cannot return result directly fix it --- packages/server/src/integrations/arangodb.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/integrations/arangodb.js b/packages/server/src/integrations/arangodb.js index f4feed8246..2b3ee1b11b 100644 --- a/packages/server/src/integrations/arangodb.js +++ b/packages/server/src/integrations/arangodb.js @@ -53,7 +53,8 @@ class ArangoDBIntegration { try { 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) { console.error("Error querying arangodb", err.message) throw err @@ -69,7 +70,8 @@ class ArangoDBIntegration { 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) { console.error("Error querying arangodb", err.message) throw err