@ewb/mongoose-query 1.1.12 → 1.1.13
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/lib/QueryModel.js +5 -1
- package/package.json +3 -2
package/lib/QueryModel.js
CHANGED
|
@@ -79,7 +79,11 @@ export class QueryModel {
|
|
|
79
79
|
return populate.filter((x) => x[type] || x.onAll);
|
|
80
80
|
}
|
|
81
81
|
async updateMany(query, $in, body) {
|
|
82
|
-
|
|
82
|
+
const $set = { ...body };
|
|
83
|
+
if (this.options.updateDateKey) {
|
|
84
|
+
$set[this.options.updateDateKey] = new Date();
|
|
85
|
+
}
|
|
86
|
+
return this._model.updateMany({ ...query, _id: { $in } }, { $set });
|
|
83
87
|
}
|
|
84
88
|
async deleteMany(query, $in) {
|
|
85
89
|
return this._model.deleteMany({ ...query, _id: { $in } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ewb/mongoose-query",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Parse queries and params to mongoose search. Strips dangerous keys and set corrects options with help of query values.",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -57,5 +57,6 @@
|
|
|
57
57
|
"pre-commit": "pretty-quick --staged"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"resolutions": {}
|
|
60
|
+
"resolutions": {},
|
|
61
|
+
"packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
|
|
61
62
|
}
|