Adding a function to update a field of a doc #79

Closed
Nesh108 opened this Issue Oct 31, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@Nesh108

Nesh108 commented Oct 31, 2012

As there is a function for deleting a single field of a doc, it would be very useful to have a function for updating just one field.

It would be also interesting to have a similar function which just is used for incrementing the value by a certain amount, for instance:

"counter" = 1

update_field("counter", 1, increment)

"counter" = 2

update_field("counter", 5, increment)

"counter" = 7

update_field("counter", 6, decrement)

"counter" = 1

@Nesh108

This comment has been minimized.

Show comment Hide comment
@Nesh108

Nesh108 Nov 6, 2012

Any info?

Nesh108 commented Nov 6, 2012

Any info?

@benoitc

This comment has been minimized.

Show comment Hide comment
@benoitc

benoitc Jan 20, 2013

Owner

couchbeam_doc:set_value does that. If you wan't atomic updates of a field in a doc this isn't possible yet with the couchdb api.

Matybe there could be an update function allowing you to walk in a doc and replace values if needed. Would it be useful?

Owner

benoitc commented Jan 20, 2013

couchbeam_doc:set_value does that. If you wan't atomic updates of a field in a doc this isn't possible yet with the couchdb api.

Matybe there could be an update function allowing you to walk in a doc and replace values if needed. Would it be useful?

@benoitc

This comment has been minimized.

Show comment Hide comment
@benoitc

benoitc Dec 5, 2013

Owner

The module couchbeam_doc already offer a bunch of functions allowing to manipulate the JSON objects. You can, set,delete,extend,fet,or take a value from them. About the latest feature it should be done at app level imo. Though an interresting feature could be adding a way to "patch" a doc.

Anyway closing this issue since most is already addressed.

Owner

benoitc commented Dec 5, 2013

The module couchbeam_doc already offer a bunch of functions allowing to manipulate the JSON objects. You can, set,delete,extend,fet,or take a value from them. About the latest feature it should be done at app level imo. Though an interresting feature could be adding a way to "patch" a doc.

Anyway closing this issue since most is already addressed.

@benoitc benoitc closed this Dec 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment