From 9521b738f7be1c80311124f4b976f5888ab5d3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Correia?= Date: Wed, 26 Jan 2022 18:02:41 +0000 Subject: [PATCH] chore: Add comment to clarify implementation. --- .../src/connections/GoogleSheet/mingoAggregation.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/plugins/connections/connection-google-sheets/src/connections/GoogleSheet/mingoAggregation.js b/packages/plugins/connections/connection-google-sheets/src/connections/GoogleSheet/mingoAggregation.js index f5245e7d4..d042a8c5d 100644 --- a/packages/plugins/connections/connection-google-sheets/src/connections/GoogleSheet/mingoAggregation.js +++ b/packages/plugins/connections/connection-google-sheets/src/connections/GoogleSheet/mingoAggregation.js @@ -23,6 +23,10 @@ import * as pipelineOperators from 'mingo/operators/pipeline/index.js'; import * as queryOperators from 'mingo/operators/query/index.js'; import * as projectionOperators from 'mingo/operators/projection/index.js'; +// "import * as" is returning different object structures when the connection is being +// imported in the build or when running the tests. +// So we check for the a default object with all the named exports, otherwise the +// returned object has all the named exports. useOperators(OperatorType.ACCUMULATOR, accumulatorOperators.default || accumulatorOperators); useOperators(OperatorType.EXPRESSION, expressionOperators.default || expressionOperators); useOperators(OperatorType.PIPELINE, pipelineOperators.default || pipelineOperators);