new doc creation improvement #4

Closed
vweyl opened this Issue Nov 18, 2012 · 0 comments

Comments

Projects
None yet
2 participants

vweyl commented Nov 18, 2012

The way couchdbstore currently implements new doc is as follows:

--> cdb.sync(db, docId)
If docId is new, Couchdb responds with a document missing which means the promise is rejected
In that case calling upload immediately after fails as well (missing _id field in cdb).

Ideally we should be able to do:
cdb.sync(db, docId).then(function(){
cdb.upload();
}
and cdb should handle the case new doc vs. existing doc.

@podefr podefr closed this Apr 13, 2013

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