【发布时间】:2015-12-17 06:20:26
【问题描述】:
我正在学习 Meteor 的绳索,有点迷失在这里。我正在使用 collections2,autoform 来构建我的应用程序。我想将集合与用户 ID 信息一起存储。因此,当我们从服务器检索集合时,我只想显示用户创建的集合,而不是其他所有内容。这是架构。
ExercisesSchema = new SimpleSchema({
"name": {
type: String,
label: 'Name'
},
"workout.$.weight": {
type: String,
label: 'Weight'
},
"workout.$.reps": {
type: String,
label: 'Reps'
},
"notes": {
type: String,
label: 'Notes',
optional: true
}
});
在服务器端,我只想显示用户创建的锻炼
Meteor.publish('exercises', function () {
return Exercises.find({owner: this.userId});
});
当我将用户 ID 添加到架构中时,它会显示在自动表单中,我不确定如何隐藏它,如果我隐藏它,那么我可以使用自动表单中的挂钩来添加值吗?
【问题讨论】:
标签: meteor meteor-autoform simple-schema