Change Update method signature to make more sense
Closed this issue · 2 comments
iros commented
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.