mongoose: Add replaceOne and updateOne to MongooseDocument (#33814)

This commit is contained in:
orblazer
2019-03-13 10:19:56 -07:00
committed by Wesley Wigham
parent a4599ab327
commit c44def78cc
+9
View File
@@ -19,6 +19,7 @@
// Frontend Monster <https://github.com/frontendmonster>
// Ming Chen <https://github.com/mingchen>
// Olga Isakova <https://github.com/penumbra1>
// Orblazer <https://github.com/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<any>;
/** Sends an update command with this document _id as the query selector. */
update(doc: any, callback?: (err: any, raw: any) => void): Query<any>;
update(doc: any, options: ModelUpdateOptions,
callback?: (err: any, raw: any) => void): Query<any>;
/** Sends an updateOne command with this document _id as the query selector. */
updateOne(doc: any, callback?: (err: any, raw: any) => void): Query<any>;
updateOne(doc: any, options: ModelUpdateOptions,
callback?: (err: any, raw: any) => void): Query<any>;
/**
* Executes registered validation rules for this document.
* @param optional options internal options