Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update/updateOrCreate in cloudant.js #35

Closed
jannyHou opened this issue Sep 27, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@jannyHou
Copy link
Contributor

commented Sep 27, 2016

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.

@jannyHou jannyHou self-assigned this Sep 27, 2016

@jannyHou jannyHou added the bug label Sep 27, 2016

@djorg83

This comment has been minimized.

Copy link

commented Apr 27, 2017

Possibly related to #110

@jannyHou

This comment has been minimized.

Copy link
Contributor Author

commented Apr 27, 2017

@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

This comment has been minimized.

Copy link
Contributor Author

commented May 4, 2017

Some possible solutions:

  • Keep it same as replaceOrCreate, and warn users there is not partial update.
  • (Tricky) We implement a way to merge data from document and updated data, then call _insert , which will do replace
  • Throw error/warning in this method to explicitly tell user they need to define their own method if they do want to partial update.

@jannyHou jannyHou referenced this issue May 4, 2017

Merged

Refactor doc #116

@jannyHou jannyHou changed the title Fix updateOrCreate in cloudant.js Fix update/updateOrCreate in cloudant.js May 24, 2017

@0candy 0candy added planning and removed needs-estimate labels May 24, 2017

@ssh24 ssh24 assigned ssh24 and unassigned jannyHou May 29, 2017

@ssh24 ssh24 added in-progress and removed planning labels May 29, 2017

@ssh24 ssh24 added this to the Sprint 37 - Apex milestone May 29, 2017

@ssh24 ssh24 added the #in-progress label May 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.