couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Smith <>
Subject Auto-UUID generation in _update [PATCH]
Date Sat, 12 Jun 2010 11:24:32 GMT
I enjoy using _show and _update functions to mimic the HTTP doc API,
adding conveniences such as auto-timestamping, etc.

One thing _update cannot duplicate vs. the normal API is automatic UUID
generation when _id is unspecified.

The only solution is to generate a UUID in the update function; but this
sacrifices reference locality using the (default) sequential internal
UUID algorithm.

Is this just something we have to endure, or can couchdb be made to fill
it in?  In principle, I feel like _update is a convenience around the
doc API. Auto-ID should be possible.

Attached is a patch as food for thought; however it has a bug: the query
server already computed the response (with arbitrary content-type and
response body). It seems too late for the couch server to go inserting
fields in the doc. But of course, the doc is invalid in the first place
if _id is undefined.

Jason Smith
Couchio Hosting

View raw message