@vasrefil/api-toolkit 1.4.1 → 1.4.3
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryHelper = void 0;
|
|
4
4
|
const date_util_1 = require("../utilities/date.util");
|
|
5
|
+
const mongoose_1 = require("mongoose");
|
|
5
6
|
class QueryHelper_ {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.process_filters = (query) => {
|
|
@@ -42,6 +43,9 @@ class QueryHelper_ {
|
|
|
42
43
|
else if (fit.operator === 'exists') {
|
|
43
44
|
result.push({ [fit.field]: { $exists: fit.value === 'true' } });
|
|
44
45
|
}
|
|
46
|
+
else if (fit.operator === 'objectId') {
|
|
47
|
+
result.push({ [fit.field]: { $eq: new mongoose_1.Types.ObjectId(fit.value) } });
|
|
48
|
+
}
|
|
45
49
|
});
|
|
46
50
|
filter_query = { [logical_operator]: result };
|
|
47
51
|
}
|