@synatic/noql
Advanced tools
Comparing version
@@ -103,3 +103,5 @@ const getParsedValueFromBinaryExpressionModule = require('./getParsedValueFromBinaryExpression'); | ||
$filter: { | ||
input: `$${depth > 0 ? '$this.' : ''}${ast.from[0].table}`, | ||
input: `$${depth > 0 ? '$this.' : ''}${ | ||
ast.from[0].db ? ast.from[0].db + '.' : '' | ||
}${ast.from[0].table}`, | ||
cond: { | ||
@@ -117,3 +119,5 @@ $and: [ | ||
} else if (ast.from[0].table) { | ||
mapInput = `$${depth > 0 ? '$this.' : ''}${ast.from[0].table}`; | ||
mapInput = `$${depth > 0 ? '$this.' : ''}${ | ||
ast.from[0].db ? ast.from[0].db + '.' : '' | ||
}${ast.from[0].table}`; | ||
} else { | ||
@@ -120,0 +124,0 @@ throw new Error('No table specified for sub array select'); |
@@ -256,3 +256,3 @@ const makeFilterConditionModule = require('./makeFilterCondition'); | ||
let fromPart; | ||
if (join.on.left.table === toAs || join.on.left.table === toTable) { | ||
if (join.on.left.table === toAs) { | ||
localPart = join.on.right; | ||
@@ -272,3 +272,5 @@ fromPart = join.on.left; | ||
const localField = localPart.table | ||
? `${localPart.table}.${localPart.column}` | ||
? `${localPart.schema ? localPart.schema + '.' : ''}${ | ||
localPart.table | ||
}.${localPart.column}` | ||
: `${previousJoin.as || previousJoin.table}.${localPart.column}`; | ||
@@ -275,0 +277,0 @@ const foreignField = fromPart.column; |
{ | ||
"name": "@synatic/noql", | ||
"version": "2.1.14", | ||
"version": "2.1.15", | ||
"description": "Convert SQL statements to mongo queries or aggregates", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
295813
0.06%7396
0.08%