【发布时间】:2017-06-30 16:48:18
【问题描述】:
我写了一个点击。调用方法的事件。此方法将单个项目 (InfoId) 推送到名为 userManagement 的集合中。所以这些项目被分配给那个用户。
事件处理程序:
Template.available.events({
"click .push": function(e) {
e.preventDefault();
var InfoId = this.InfoId;
Meteor.call('pushInfo', InfoId);
}, });
以及方法:
Meteor.methods({
'pushInfo': function(InfoId) {
if (this.userId) {
userManagement.update({
'_id': this.userId
}, {
$push: {
'activeInfos': InfoId
}
}
);
}
}
});
但是,现在我需要在特定时间段 e 后从“activeInfos”中自动删除之前添加的单个项目 (InfoId)。 G。三个月。
有什么办法吗?
【问题讨论】:
标签: mongodb meteor methods collections timer