c2-mongoose 2.1.317 → 2.1.318
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.
- package/dist/flow/SearcherFlow.js +11 -0
- package/package.json +1 -1
- package/src/flow/SearcherFlow.ts +17 -0
|
@@ -236,6 +236,17 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
236
236
|
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.tz('America/Sao_Paulo', false).toDate() });
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
+
else if (key.endsWith('Range')) {
|
|
240
|
+
var fieldName = key.replace('Range', '');
|
|
241
|
+
var values = value;
|
|
242
|
+
if ((0, Utils_1.isNotEmpty)(values[0])) {
|
|
243
|
+
var momentValue = (0, moment_1.default)(values[0]);
|
|
244
|
+
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: values[0] });
|
|
245
|
+
}
|
|
246
|
+
if ((0, Utils_1.isNotEmpty)(values[1])) {
|
|
247
|
+
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: values[1] });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
239
250
|
else if (key.endsWith('Like')) {
|
|
240
251
|
var fieldName = key.replace('Like', '');
|
|
241
252
|
condition[fieldName] = this.buildRegex(value); //{ $regex: value as any, $options: 'i' }
|
package/package.json
CHANGED
package/src/flow/SearcherFlow.ts
CHANGED
|
@@ -213,6 +213,23 @@ class SearcherFlow<D> {
|
|
|
213
213
|
$lte: momentValue.tz('America/Sao_Paulo', false).toDate()
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
+
} else if (key.endsWith('Range')) {
|
|
217
|
+
var fieldName = key.replace('Range', '')
|
|
218
|
+
var values = value as any
|
|
219
|
+
if (isNotEmpty(values[0])) {
|
|
220
|
+
var momentValue = moment(values[0])
|
|
221
|
+
condition[fieldName] = {
|
|
222
|
+
...condition[fieldName],
|
|
223
|
+
$gte: values[0]
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (isNotEmpty(values[1])) {
|
|
228
|
+
condition[fieldName] = {
|
|
229
|
+
...condition[fieldName],
|
|
230
|
+
$lte: values[1]
|
|
231
|
+
}
|
|
232
|
+
}
|
|
216
233
|
} else if (key.endsWith('Like')) {
|
|
217
234
|
var fieldName = key.replace('Like', '')
|
|
218
235
|
condition[fieldName] = this.buildRegex(value as string) //{ $regex: value as any, $options: 'i' }
|