File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,12 @@ import {
9999} from './utils' ;
100100import { WriteConcern , WriteConcernOptions } from './write_concern' ;
101101
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+ */
103108export interface ModifyResult < TSchema = Document > {
104109 value : WithId < TSchema > | null ;
105110 lastErrorObject ?: Document ;
Original file line number Diff line number Diff line change @@ -348,3 +348,21 @@ expectType<WithId<{ a: number; b: string }> | null>(
348348expectType < WithId < { a : number ; b : string } > | null > (
349349 ( await coll . findOneAndDelete ( { a : 3 } , { projection : { _id : 0 } } ) ) . value
350350) ;
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