misoproject / dataset

JavaScript library that makes managing the data behind client-side visualisations easy
http://misoproject.com
GNU General Public License v2.0
1.18k stars 99 forks source link

Change Update method signature to make more sense #168

Closed iros closed 11 years ago

iros commented 12 years ago

Single row update:

ds.update({ _id : 4, prop : 23 });
// old method : ds.update(4, { prop : 23 });

Multi row update:

ds.update([{ _id : 4, prop : 23 }, { _id : 4, prop : 23 }]);

Flexible updates based on row:


ds.update( function (row) { 

  if (row.x == 12) {
    row.y = 144;
    return row;
  }

  return false;
});

Always need to return false for rows that dont' need updating so we don't run an update on all rows that haven't actually changed.

iros commented 12 years ago

Also resolves #163

iros commented 12 years ago

Also resolves #162