couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject POST with _id
Date Mon, 03 Aug 2009 09:04:24 GMT
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.

Mime
View raw message