You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/query.js
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3311,6 +3311,7 @@ function prepareDiscriminatorCriteria(query) {
3311
3311
* - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0
3312
3312
* - `runValidators`: if true, runs [update validators](https://mongoosejs.com/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema.
3313
3313
* - `setDefaultsOnInsert`: `true` by default. If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created.
3314
+
* - `strictFilter`: bool - if true, throws an error if the filter is empty (`{}`). Defaults to false.
3314
3315
*
3315
3316
* #### Example:
3316
3317
*
@@ -3337,6 +3338,7 @@ function prepareDiscriminatorCriteria(query) {
3337
3338
* @param {Boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object.
3338
3339
* @param {Boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key
3339
3340
* @param {Boolean} [options.overwriteImmutable=false] Mongoose removes updated immutable properties from `update` by default (excluding $setOnInsert). Set `overwriteImmutable` to `true` to allow updating immutable properties using other update operators.
3341
+
* @param {Boolean} [options.strictFilter=false] If true, throws an error if the filter is empty (`{}`)
0 commit comments