update

function
 update() 

Option name Type Description
idOrObject String, Object

id or object with .id property

[change] Object, Function

Changed properties or function that changes existing object

return Promise

updates existing object.

function update (objectsOrIds, change) {
  if (typeof objectsOrIds !== 'object' && !change) {
    return this.constructor.utils.Promise.reject(
      new Error('Must provide change')
    )
  }

  return Array.isArray(objectsOrIds)
    ? updateMany.call(this, objectsOrIds, change)
    : updateOne.call(this, objectsOrIds, change)
}