-
Notifications
You must be signed in to change notification settings - Fork 157
Couch returning 409's #45
Comments
Well, the underlying error is that attaching (or deleting attachments) is just a normal update to a document. It requires a revision ID just like any other update. You can either add What would be great is for nano to do the right thing transparently, either fetching first to get a revision, or else add the correct header if the |
Can I ask you where did you learn about nano? If it was a blogpost I would like to cross post this response. 409 means conflict. Meaning you are trying to update but not specifying the rev. If this isn't enough help I got this from the documentation regarding specifying revs: https://github.com/dscape/nano/blob/master/nano.js#L467-#L470 So you need to get the document, see the latest rev, and update the attachment according to the rev. Or you can simply delete the document which will reset the rev. If this isn't enough I can write a working example. Also advice you to read the free CouchDB book by @jchris http://guide.couchdb.org/editions/1/en/index.html |
@jhs do you think this would be expected behavior? I would expect it to throw 409 if I don't know the rev, e.g. I might be updating the wrong attachment ? |
Hi all, I found the problem. I was doing a check on the revision, but because it was doing an update before adding the attachment the revision number was changing. Dscape: I found nano through a friend, and he pointed me to this site: http://writings.nunojob.com/2011/08/nano-minimalistic-couchdb-client-for-nodejs.html |
Great @xsyn - btw doing a cms in a document database makes a lot of sense :) doing it in a relational db, not so much :P |
:) I'm still getting my head around the user management though. Thanks for your help. |
There's a special Check the session tests for some pointers |
@dscape yes, sorry, I misunderstood. For some reason I thought the doc was already known in state somewhere. |
We now test against latest stable, latest v4, latest v6 and latest v7
I've read through the documentation, and I may be doing this wrong, but when I try to insert an image, from file, into a currently existing document and I do:
I get back a 409 from couchdb, am I implementing this incorrectly?
The text was updated successfully, but these errors were encountered: