cloudant / meteor-couchdb

Meteor database driver for CouchDB and Cloudant
Other
53 stars 7 forks source link

support Database.update(selector, modifier) signature #3

Open mariobriggs opened 9 years ago

mariobriggs commented 9 years ago

today API is Database.update(docToReplace)

we can support Database.update(selector, modifier) signature implement parse of modifier and setting fields via javascript using updateHandler for id based updates, existing updateHandler features will work for selector based updates, couchDB enhancement that updateHandler takes a selector (until then implement in client as find(selector) followed by update(id,updateHandler)

Supporting this signature allows simpler security checks via DB.allow/deny(), since can see which fields user is changing.