couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goodall <>
Subject _bulk_docs inconsistency
Date Mon, 06 Apr 2009 17:42:40 GMT

I came across an inconsistency with _bulk_docs when creating new
documents, i.e. calling _bulk_docs against an empty database.

It seems that it's ok to create a new document from a JSON object that
includes a _rev ... unless the JSON also has inline attachments:

$ curl -X "POST" -d
$ curl -X "POST" -d
[{"id":"b","error":"conflict","reason":"Document update conflict."}]

I'll write JS tests for this and create a ticket but, at this stage,
I'm not sure what the correct behaviour is:

1. CouchDB should not allow a document to be created from JSON
containing a _rev at all.
2. JSON that includes _rev and _attachements should work.

Assuming the _rev is allowed, should CouchDB then:

1. Completely ignore the _rev in the JSON and assign a new 1-based
rev, i.e. 1-abc in, 1-def out.
2. Allow the _rev in the JSON and assign a new, incremented rev, i.e.
1-abc in, 2-def out.
3. Accept the _rev in the JSON as-is, i.e. 1-abc in, 1-abc out. (I'm
not expecting this one to be correct!)

- Matt

View raw message