Closed jannyHou closed 7 years ago
Possibly related to #110
@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.
Some possible solutions:
replaceOrCreate
, and warn users there is not partial update._insert
, which will do replace@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
Use
updateAttributes
function toupdate
a model instance and useupdate
function in call forupdateOrCreate
.Currently,
update
performs a destructive update. With this changeupdate
function should be partial update.