From 18e5db1961ddcdd0f46081185c20f937b9c7337d Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Tue, 16 Feb 2021 11:49:31 -0500 Subject: [PATCH] docs(connection): clarify that `Connection#transaction()` promise resolves to a command result Fix #9919 --- lib/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index 185948e696b..83ff8f8c9a0 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -469,7 +469,7 @@ Connection.prototype.startSession = _wrapConnHelper(function startSession(option * @method transaction * @param {Function} fn Function to execute in a transaction * @param {mongodb.TransactionOptions} [options] Optional settings for the transaction - * @return {Promise} promise that resolves to the returned value of `fn` + * @return {Promise} promise that is fulfilled if Mongoose successfully committed the transaction, or rejects if the transaction was aborted or if Mongoose failed to commit the transaction. If fulfilled, the promise resolves to a MongoDB command result. * @api public */