c2-mongoose 2.1.316 → 2.1.317
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -245,9 +245,7 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
245
245
|
var fields = key.split('.');
|
|
246
246
|
if (!fields)
|
|
247
247
|
return condition;
|
|
248
|
-
|
|
249
|
-
// elemMatch[lastField] = value as boolean
|
|
250
|
-
condition[fields[0]] = { $elemMatch: (_a = {}, _a[fields[1]] = value, _a) };
|
|
248
|
+
condition[fields[0]] = { $elemMatch: (_a = {}, _a[fields[1]] = { $exists: value }, _a) };
|
|
251
249
|
}
|
|
252
250
|
else if (key.endsWith('Exists')) {
|
|
253
251
|
var fieldName = key.replace('Exists', '');
|
package/package.json
CHANGED
package/src/flow/SearcherFlow.ts
CHANGED
|
@@ -222,9 +222,7 @@ class SearcherFlow<D> {
|
|
|
222
222
|
const fields = key.split('.')
|
|
223
223
|
if (!fields) return condition;
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
// elemMatch[lastField] = value as boolean
|
|
227
|
-
condition[fields[0]] = { $elemMatch: { [fields[1]]: value as boolean } }
|
|
225
|
+
condition[fields[0]] = { $elemMatch: { [fields[1]]: { $exists: value as boolean } } }
|
|
228
226
|
} else if (key.endsWith('Exists')) {
|
|
229
227
|
var fieldName = key.replace('Exists', '')
|
|
230
228
|
condition[fieldName] = { $exists: value as boolean }
|