8
我正在使用CouchDB实现消息应用程序。我想将时间戳应用于每封邮件。我发现一些参考文献指出我应该使用document update handlers。就地更新看起来是正确的。但是我会在哪里获得时间戳?它在某个地方是否需要req对象?CouchDb自动时间戳
{
updates: {
"in-place" : function(doc, req) {
doc.timestamp = "???";
var message = "set timestamp to "+doc.timestamp;
return [doc, message];
}
}
}
http://stackoverflow.com/questions/4812235/whats-the-best-way-to-store-datetimes-timestamps-in-couchdb – abernier 2012-11-11 15:05:13