async _upsert (object, { collection, options } = {}) {
      if (!object) throw new IllegalArgumentError({ info: { object } })
      object._id = object._id || uuid()

      await this._tryDbOp(async () => await this._getCollection(collection).updateOne(
        { _id: object._id },
        { $set: object },
        { ...options, upsert: true }
      ))

      return object
    }
/**
     * Inserts a new document or updates, partially or completely, an existing document.
     *
     * @private
     */
Inserts a new document or updates, partially or completely, an existing document.
@private
Inserts a new document or updates partially or completely an existing document . @private
async _upsert (object, { collection, options } = {}) {
      if (!object) throw new IllegalArgumentError({ info: { object } })
      object._id = object._id || uuid()
      await this._tryDbOp(async () => await this._getCollection(collection).updateOne(
        { _id: object._id },
        { $set: object },
        { ...options, upsert: true }
      ))
      return object
    }
async _upsert ( object , { collection , options } = { } ) { if ( ! object ) throw new IllegalArgumentError ( { info : { object } } ) object . _id = object . _id || uuid ( ) await this . _tryDbOp ( async ( ) => await this . _getCollection ( collection ) . updateOne ( { _id : object . _id } , { $set : object } , { ... options , upsert : true } ) ) return object }
Inserts a new document or updates, partially or completely, an existing document.
Inserts a new document or updates partially or completely an existing document .