mongoose 6.7.4 → 6.7.5
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/browser.umd.js +1 -1
- package/lib/helpers/schema/merge.js +1 -0
- package/lib/queryhelpers.js +5 -0
- package/package.json +1 -1
- package/types/index.d.ts +6 -1
package/lib/queryhelpers.js
CHANGED
|
@@ -163,6 +163,11 @@ exports.applyPaths = function applyPaths(fields, schema) {
|
|
|
163
163
|
if (!isDefiningProjection(field)) {
|
|
164
164
|
continue;
|
|
165
165
|
}
|
|
166
|
+
// `_id: 1, name: 0` is a mixed inclusive/exclusive projection in
|
|
167
|
+
// MongoDB 4.0 and earlier, but not in later versions.
|
|
168
|
+
if (keys[keyIndex] === '_id' && keys.length > 1) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
166
171
|
exclude = !field;
|
|
167
172
|
break;
|
|
168
173
|
}
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -496,7 +496,12 @@ declare module 'mongoose' {
|
|
|
496
496
|
$pullAll?: AnyKeys<TSchema> & AnyObject;
|
|
497
497
|
|
|
498
498
|
/** @see https://docs.mongodb.com/manual/reference/operator/update-bitwise/ */
|
|
499
|
-
|
|
499
|
+
// Needs to be `AnyKeys` for now, because anything stricter makes us incompatible
|
|
500
|
+
// with the MongoDB Node driver's `UpdateFilter` interface (see gh-12595, gh-11911)
|
|
501
|
+
// and using the Node driver's `$bit` definition breaks because their `OnlyFieldsOfType`
|
|
502
|
+
// interface breaks on Mongoose Document class due to circular references.
|
|
503
|
+
// Re-evaluate this when we drop `extends Document` support in document interfaces.
|
|
504
|
+
$bit?: AnyKeys<TSchema>;
|
|
500
505
|
};
|
|
501
506
|
|
|
502
507
|
export type UpdateWithAggregationPipeline = UpdateAggregationStage[];
|