async _transactionallyExecute (
      fn,
      options = {
        readPreference: 'primary',
        readConcern: { level: 'local' },
        writeConcern: { w: 'majority' }
      }
    ) {
      let session

      try {
        session = this._client.startSession()
        return session.withTransaction(fn, options)
      } finally {
        if (session) await session.endSession()
      }
    }
/**
     * Executes the given function within the scope of a transaction.
     * @param {Function} fn The function to execute; must return a `Promise`.
     * @param {Object} [options] Transaction options; see http://mongodb.github.io/node-mongodb-native/3.6/api/global.html#TransactionOptions for supported properties.
     * @return {Promise<*>} The promise returned by param `fn`.
     */
Executes the given function within the scope of a transaction.
@param {Function} fn The function to execute; must return a `Promise`.
Executes the given function within the scope of a transaction . @param { Function } fn The function to execute ; must return a ` Promise ` .
async _transactionallyExecute (
      fn,
      options = {
        readPreference: 'primary',
        readConcern: { level: 'local' },
        writeConcern: { w: 'majority' }
      }
    ) {
      let session
      try {
        session = this._client.startSession()
        return session.withTransaction(fn, options)
      } finally {
        if (session) await session.endSession()
      }
    }
async _transactionallyExecute ( fn , options = { readPreference : 'primary' , readConcern : { level : 'local' } , writeConcern : { w : 'majority' } } ) { let session try { session = this . _client . startSession ( ) return session . withTransaction ( fn , options ) } finally { if ( session ) await session . endSession ( ) } }
Executes the given function within the scope of a transaction.
Executes the given function within the scope of a transaction .