File tree 2 files changed +24
-1
lines changed
2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,12 @@ import {
99
99
} from './utils' ;
100
100
import { WriteConcern , WriteConcernOptions } from './write_concern' ;
101
101
102
- /** @public */
102
+ /**
103
+ * @public
104
+ * @deprecated This type will be completely removed in 5.0 and findOneAndUpdate,
105
+ * findOneAndDelete, and findOneAndReplace will then return the
106
+ * actual result document.
107
+ */
103
108
export interface ModifyResult < TSchema = Document > {
104
109
value : WithId < TSchema > | null ;
105
110
lastErrorObject ?: Document ;
Original file line number Diff line number Diff line change @@ -348,3 +348,21 @@ expectType<WithId<{ a: number; b: string }> | null>(
348
348
expectType < WithId < { a : number ; b : string } > | null > (
349
349
( await coll . findOneAndDelete ( { a : 3 } , { projection : { _id : 0 } } ) ) . value
350
350
) ;
351
+
352
+ // NODE-3568: Uncomment when ModifyResult is removed in 5.0
353
+ // expectType<WithId<TSchema> | null> | null>((await coll.findOneAndDelete({ a: 3 })));
354
+ // expectType<WithId<TSchema> | null>(
355
+ // (await coll.findOneAndReplace({ a: 3 }, { a: 5, b: 'new string' }))
356
+ // );
357
+ // expectType<WithId<TSchema> | null>(
358
+ // (
359
+ // await coll.findOneAndUpdate(
360
+ // { a: 3 },
361
+ // {
362
+ // $set: {
363
+ // a: 5
364
+ // }
365
+ // }
366
+ // )
367
+ // )
368
+ // );
You can’t perform that action at this time.
0 commit comments