loopbackio / loopback-connector-cloudant

LoopBack Connector for IBM Cloudant
Other
19 stars 21 forks source link

Fix update/updateOrCreate in cloudant.js #35

Closed jannyHou closed 7 years ago

jannyHou commented 8 years ago

Use updateAttributes function to update a model instance and use update function in call for updateOrCreate.

Currently, update performs a destructive update. With this change update function should be partial update.

djorg83 commented 7 years ago

Possibly related to #110

jannyHou commented 7 years ago

@djorg83 thanks for catching the error in #110 , this is not the same one. cloudant only support full replace of document, but not partial update. This issue will implement an update method which does partial update.

jannyHou commented 7 years ago

Some possible solutions:

cwadding commented 4 years ago

@jannyHou one solution for a partial update are to use update handlers https://cloud.ibm.com/docs/services/Cloudant/api?topic=cloudant-design-documents#update-handlers This would need to be enabled on the cloudant database but can make it so that the updates are not a destructive operation. It might would be nice to be able to specify the desired update handler