【发布时间】:2015-04-04 01:33:49
【问题描述】:
我已经发布了一个帖子模型,并且运行良好。但是,我通过 simpleSchemas 插件添加了以下字段:
userEmail: {
type: String,
autoValue: function() {
if (this.isInsert) {
return Meteor.user().email;
} else if (this.isUpsert) {
return {$setOnInsert: Meteor.user().email};
} else {
this.unset();
}
}
}
启用此功能后,提交表单不起作用,但不会引发任何错误。我可能不正确地调用Meteor.user().email 吗?如何将 userEmail 字段与创建帖子的用户的电子邮件相关联?
【问题讨论】:
标签: meteor meteor-accounts meteor-autoform