codeswarm / sails-couchdb-orm

CouchDB Adapter for the Sails.js ORM Framework, Waterline
36 stars 20 forks source link

should `merge` not just be called `update`? #1

Open 0xgeert opened 10 years ago

0xgeert commented 10 years ago

If I'm reading the code correctly merge does a partial update, whereas update requires all fields to be present as is the normal CouchDB way.

However, calling model.update within the context of SailsJS, one would expect 'partial update' functionality. This is the implementation of all other adapters afaik? (a guess to be honest).

If correct, wouldn't it make sense to rename model.merge to model.update?

mikehostetler commented 10 years ago

I will look into other adapters and check. If that's the case I would agree it makes sense to change the name.