How can I systematically add a time stamp to new documents in Meteor? -
when new document inserted collection, i'd add time stamp it. want server this, not client. best solution here?
rem: i'd rather not implement own custom meteor.methods()
this, use classical meteor.collection.insert()
method
from here - https://github.com/oortcloud/unofficial-meteor-faq
blockquote
how can alter every document before added database?
there isn't support right now, can use deny achieve want on server. example, timestamp each document goes mongo:
posts.deny({ insert: function(userid, doc) { doc.createdat = new date().valueof(); return false; }})
```
Comments
Post a Comment