Is there any reason why, if you POST a document to a database and that
document has an "_id" member, why this is ignored and a server-generated _id
is used instead?

$ curl -X PUT http://127.0.0.1:5984/sample
{"ok":true}
$ curl --data-binary '{"_id":"foo","bar":"baz"}' -X POST 
http://127.0.0.1:5984/sample
{"ok":true,"id":"f38341efa1ca9bebc528b452aa036846","rev":"1-4165745669"}

This seems inconsisent with a POST to _bulk_docs

$ curl --data-binary '{"docs":[{"_id":"foo","bar":"baz"}]}' -X POST 
http://127.0.0.1:5984/sample/_bulk_docs
[{"id":"foo","rev":"1-1298018621"}]

Thanks,

Brian.

Reply via email to