Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1001

Support withTransaction in session API

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 2
    • Needed
    • Hide

      mongosh now provides a session.withTransaction(fn[, options]) method. The behavior matches the Node.js driver’s equivalent: https://mongodb.github.io/node-mongodb-native/4.1/classes/ClientSession.html#withTransaction

      (The “IMPORTANT: This method requires the user to return a Promise” notice from the driver docs does not apply to mongosh.)

      Show
      mongosh now provides a session.withTransaction(fn [, options] ) method. The behavior matches the Node.js driver’s equivalent: https://mongodb.github.io/node-mongodb-native/4.1/classes/ClientSession.html#withTransaction (The “IMPORTANT: This method requires the user to return a Promise” notice from the driver docs does not apply to mongosh.)
    • Iteration Minsk

      The driver provides a withTransaction helper in addition to startTransaction, commitTransaction and abortTransaction. Since it is significantly easier to use, and not hard to add, we should also consider adding a helper for this.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: