incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Huggins" <ja...@jrandolph.com>
Subject Auto-adding additional fields on PUT/POST? (datetime stamps)
Date Mon, 01 Dec 2008 16:29:39 GMT
Hello all!

I would like some meta-data to get inserted into documents when my
users create them. At a minimum, something like Created and
LastModified datetime stamps would be nice. Currently, the users have
to manually add these fields when they POST or PUT. Ideally, there is
something I can do on the server side to "automagically" add those
fields for them.

I think the easiest thing to do is to create a DBNotificationUpdate
script that looks for new documents and updates them with the datetime
data as a document revision.

Is there a better way to handle this? I think I want something like
what happens now with the creation of the "_id" field... If "_id" is
missing, CouchDB will add it to the document on the user's behalf at
document creation time.

Thanks, and happy couching!

-jason
http://saucelabs.com

Mime
View raw message