File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -341,3 +341,16 @@ function gh12091() {
341
341
}
342
342
update . $addToSet . friendsNames = 'Jane Doe' ;
343
343
}
344
+
345
+ function gh12142 ( ) {
346
+ const schema = new Schema ( { name : String , comments : [ { text : String } ] } ) ;
347
+
348
+ const Test = model ( 'Test' , schema ) ;
349
+
350
+ Test . updateOne (
351
+ { _id : new Types . ObjectId ( ) } ,
352
+ {
353
+ $pull : { comments : new Types . ObjectId ( ) }
354
+ }
355
+ ) ;
356
+ }
Original file line number Diff line number Diff line change @@ -457,8 +457,8 @@ declare module 'mongoose' {
457
457
/** @see https://docs.mongodb.com/manual/reference/operator/update-array/ */
458
458
$addToSet ?: Mutable < mongodb . SetFields < TSchema > > ;
459
459
$pop ?: AnyKeys < TSchema > & AnyObject ;
460
- $pull ?: Mutable < mongodb . PullOperator < TSchema > > ;
461
- $push ?: Mutable < mongodb . PushOperator < TSchema > > ;
460
+ $pull ?: AnyKeys < TSchema > & AnyObject ;
461
+ $push ?: AnyKeys < TSchema > & AnyObject ;
462
462
$pullAll ?: AnyKeys < TSchema > & AnyObject ;
463
463
464
464
/** @see https://docs.mongodb.com/manual/reference/operator/update-bitwise/ */
You can’t perform that action at this time.
0 commit comments