@synatic/noql
Advanced tools
Comparing version 4.1.1 to 4.1.2
@@ -161,8 +161,5 @@ const makeFilterConditionModule = require('./makeFilterCondition'); | ||
} | ||
if (joinHints.includes('nooptimize')) { | ||
lookupPipeline.push({$match: {$expr: joinQuery}}); | ||
} else { | ||
lookupPipeline.unshift({$match: {$expr: joinQuery}}); | ||
} | ||
lookupPipeline.push({$match: {$expr: joinQuery}}); | ||
pipeline.push({ | ||
@@ -169,0 +166,0 @@ $lookup: { |
@@ -11,2 +11,3 @@ const {snakeCase} = require('lodash'); | ||
const optimizationsEnabled = true; | ||
/** | ||
@@ -21,2 +22,9 @@ * | ||
function optimizeJoinAndWhere(pipeline, pipeLineJoin, wherePiece, context) { | ||
if (!optimizationsEnabled || context.joinHints.includes('nooptimize')) { | ||
pushToPipeline({ | ||
wasOptimised: false, | ||
leftOverMatches: [], | ||
}); | ||
return; | ||
} | ||
const originalPipeline = cloneDeep(pipeline); | ||
@@ -23,0 +31,0 @@ const originalPipelineJoin = cloneDeep(pipeLineJoin); |
{ | ||
"name": "@synatic/noql", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Convert SQL statements to mongo queries or aggregates", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
336444
8652