lib/mongodb/MongoDBCollection.js
function(object, options, context) {
    var result = this.collection.findOneAndReplace(
      {_id: object._id}, object, options.driverOptions)
    return {
      val: result.value,
      created: options.driverOptions.upsert && !result.lastErrorObject.updatedExisting
    }
  }
function(object, options, context) {
    var result = this.collection.findOneAndReplace(
      {_id: object._id}, object, options.driverOptions)
    return {
      val: result.value,
      created: options.driverOptions.upsert && !result.lastErrorObject.updatedExisting
    }
  }
function ( object , options , context ) { var result = this . collection . findOneAndReplace ( { _id : object . _id } , object , options . driverOptions ) return { val : result . value , created : options . driverOptions . upsert && ! result . lastErrorObject . updatedExisting } }
***************************************************************************
@method saveObject
@override
@description Replace or insert an object with a known ID
@param {Object} object -- The object to save (with ID)
@param {Object} options -- The operation parameters (see:
{@link carbond.mongodb.Collection.SaveObjectConfigClass})
@param {Object} context -- A free form object to pass data between hook and handler
methods
@returns {typedef:carbond.collections.Collection.SaveObjectResult}
@throws {carbond.collections.errors.CollectionError}
***************************************************************************