Change Update method signature to make more sense #168

Closed
iros opened this Issue Sep 2, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Owner

iros commented Sep 2, 2012

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.

@ghost ghost assigned alexgraul Sep 2, 2012

Owner

iros commented Sep 2, 2012

Also resolves #163

Owner

iros commented Sep 2, 2012

Also resolves #162

@iros iros referenced this issue Sep 3, 2012

Closed

bulk records update #162

iros added a commit that referenced this issue Oct 26, 2012

Merge pull request #178 from misoproject/168.updatechange
Updating the .update api in accordance ith ticket #168.

@iros iros closed this Oct 26, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment