I'm following IBM's tutorial on CouchDB and ran into a problem saving edited documents. Saving a new doc works fine, and it looks like all my existing doc's values (retrieved via the openDoc function) are valid, but the new values are simply not taking.
As I trace through the executing code, it looks like the new values are there:

However, after saveDoc returns successfully (strange!), the doc is not updated. If I log the updated doc, the logged object has no _id or _rev values, though you can clearly see they were present while saving (see first screenshot).

Is there some nuance of saveDoc, or perhaps Evently, that I'm not understanding?
In your
successcallback, you are not logging the updated document, your are logging thenewdocobject from line 87 (minus it went through thesaveDocfunction, which apparently undefined_idand_rev, but that's ok).The
successcallback can have an argument that is the response from the server. If you write :you should see in the response a new
_revstarting with2-.If you really want to see the full doc once updated, just call
openDocfrom yoursuccesscallback to get the updated version.Other detail, when you say
I think you meant that the
successcallback is called, becausesaveDocis asynchronous and should return instantly anyway.