I've got a patch coming for this. Just need to write tests for it. First contribution! *woot*
On Tue, Mar 2, 2010 at 4:53 PM, Jim Garvin <[email protected]> wrote: > Hi again, > > Does anyone know a server-side workaround for this > bug<https://issues.apache.org/jira/browse/COUCHDB-645> > ? > > Apparently if you use an _update handler for creating a document you are > responsible for the _id because CouchDB won't set it to a UUID if you just > leave it undefined. :'( > > Here's my update handler for reference: > > function(doc, req) { > var newDoc = JSON.parse(req.body); > newDoc.created_at = (new Date()).getTime(); > // newDoc._id = "is there a function I can call here to generate a > UUID?"; > return [newDoc, "ok"]; > } > > Thanks, > Jim > > >
