From c44def78ccc5d8fe940da29c2f4a40cc187504a2 Mon Sep 17 00:00:00 2001 From: orblazer Date: Wed, 13 Mar 2019 18:19:56 +0100 Subject: [PATCH] mongoose: Add replaceOne and updateOne to MongooseDocument (#33814) --- types/mongoose/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 7b02fb96d6..44f3b1111a 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -19,6 +19,7 @@ // Frontend Monster // Ming Chen // Olga Isakova +// Orblazer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1431,11 +1432,19 @@ declare module "mongoose" { */ unmarkModified(path: string): void; + /** Sends an replaceOne command with this document _id as the query selector. */ + replaceOne(replacement: any, callback?: (err: any, raw: any) => void): Query; + /** Sends an update command with this document _id as the query selector. */ update(doc: any, callback?: (err: any, raw: any) => void): Query; update(doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; + /** Sends an updateOne command with this document _id as the query selector. */ + updateOne(doc: any, callback?: (err: any, raw: any) => void): Query; + updateOne(doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + /** * Executes registered validation rules for this document. * @param optional options internal options