From 731cd23f8d3446e31925e785f853de3205edfbcf Mon Sep 17 00:00:00 2001 From: Taka Date: Tue, 18 Sep 2018 15:11:38 +0900 Subject: [PATCH] Add getter/setter around the session associated with document --- types/mongoose/index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 6c0c384284..b8fd942dac 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1104,6 +1104,9 @@ declare module "mongoose" { /** Checks if a path is set to its default. */ $isDefault(path?: string): boolean; + /** Getter/setter around the session associated with this document. */ + $session(session: ClientSession): ClientSession; + /** * Takes a populated field and returns it to its unpopulated state. * If the path was not populated, this is a no-op. @@ -1936,7 +1939,7 @@ declare module "mongoose" { /** * Sets the [MongoDB session](https://docs.mongodb.com/manual/reference/server-sessions/) * associated with this query. Sessions are how you mark a query as part of a - * [transaction](/docs/transactions.html). + * [transaction](/docs/transactions.html). */ session(session: mongodb.ClientSession | null): this; @@ -2764,8 +2767,8 @@ declare module "mongoose" { /** sets the document fields to return */ select?: any; }, callback?: (err: any, res: T | null) => void): DocumentQuery; - - + + /** * Issue a mongodb findOneAndDelete command by a document's _id field. * findByIdAndDelete(id, ...) is equivalent to findByIdAndDelete({ _id: id }, ...).