update(target, attrs) {
    let records;

    if (typeof attrs === "undefined") {
      attrs = target;
      let changedRecords = [];

      this._records.forEach((record) => {
        let oldRecord = Object.assign({}, record);

        this._updateRecord(record, attrs);

        if (!isEqual(oldRecord, record)) {
          changedRecords.push(record);
        }
      });

      return changedRecords;
    } else if (typeof target === "number" || typeof target === "string") {
      let id = target;
      let record = this._findRecord(id);

      this._updateRecord(record, attrs);

      return record;
    } else if (Array.isArray(target)) {
      let ids = target;
      records = this._findRecords(ids);

      records.forEach((record) => {
        this._updateRecord(record, attrs);
      });

      return records;
    } else if (typeof target === "object") {
      let query = target;
      records = this._findRecordsWhere(query);

      records.forEach((record) => {
        this._updateRecord(record, attrs);
      });

      return records;
    }
  }
Updates one or more records in the collection.

    If *attrs* is the only arg present, updates all records in the collection according to the key-value pairs in *attrs*.

    If *target* is present, restricts updates to those that match *target*. If *target* is a number or string, finds a single record whose id is *target* to update. If *target* is a POJO, queries *collection* for records that match the key-value pairs in *target*, and updates their *attrs*.

    Returns the updated record or records.

    ```js
    // Given users = [
    //   {id: 1, name: 'Link'},
    //   {id: 2, name: 'Zelda'}
    // ]

    db.users.update({name: 'Ganon'}); // db.users = [{id: 1, name: 'Ganon'}, {id: 2, name: 'Ganon'}]
    db.users.update(1, {name: 'Young Link'}); // db.users = [{id: 1, name: 'Young Link'}, {id: 2, name: 'Zelda'}]
    db.users.update({name: 'Link'}, {name: 'Epona'}); // db.users = [{id: 1, name: 'Epona'}, {id: 2, name: 'Zelda'}]
    ```

    @method update
    @param target
    @param attrs
    @public