c2-mongoose 2.1.297 → 2.1.299
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.
|
@@ -274,7 +274,12 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
274
274
|
condition[key] = { $nin: value };
|
|
275
275
|
}
|
|
276
276
|
else {
|
|
277
|
-
|
|
277
|
+
if (value.length > 0) {
|
|
278
|
+
condition[key] = { $in: value };
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
condition[key] = value;
|
|
282
|
+
}
|
|
278
283
|
}
|
|
279
284
|
}
|
|
280
285
|
else if (Array.isArray(value)) {
|
|
@@ -307,7 +312,7 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
307
312
|
var andQueriesParam = {};
|
|
308
313
|
Object.entries(objectSearch).forEach(function (_a) {
|
|
309
314
|
var key = _a[0], value = _a[1];
|
|
310
|
-
if (
|
|
315
|
+
if (value !== undefined || value === null) {
|
|
311
316
|
if ([
|
|
312
317
|
'or',
|
|
313
318
|
'filters',
|
package/package.json
CHANGED
package/src/flow/SearcherFlow.ts
CHANGED
|
@@ -252,7 +252,11 @@ class SearcherFlow<D> {
|
|
|
252
252
|
key = key.replace("notIn", "");
|
|
253
253
|
condition[key] = { $nin: value };
|
|
254
254
|
} else {
|
|
255
|
-
|
|
255
|
+
if (value.length > 0) {
|
|
256
|
+
condition[key] = { $in: value };
|
|
257
|
+
} else {
|
|
258
|
+
condition[key] = value;
|
|
259
|
+
}
|
|
256
260
|
}
|
|
257
261
|
} else if (Array.isArray(value)) {
|
|
258
262
|
var arr = [];
|
|
@@ -286,7 +290,7 @@ class SearcherFlow<D> {
|
|
|
286
290
|
|
|
287
291
|
let andQueriesParam = {} as any
|
|
288
292
|
Object.entries(objectSearch).forEach(([key, value]) => {
|
|
289
|
-
if (
|
|
293
|
+
if (value !== undefined || value === null) {
|
|
290
294
|
if ([
|
|
291
295
|
'or',
|
|
292
296
|
'filters',
|