将集合加载到流星中的快速表单

load collections to a quickform in meteor

我为 payments 集合和 memberProfile 创建了两个单独的模式。现在我需要创建一个 quickform 以便我可以加载与唯一 memberProfile 相关的所有付款。

     //The code for memberPayment collection

MemberProfiles = new Mongo.Collection('memberProfiles');


RecipeSchema = new SimpleSchema({
name: {
    type: String,
    label: "Name"
},
desc: {
    type: String,
    label: "Description"
},
payments:{
    type: [PaymentSchema],
    autoValue: function () {
        return Payments.find({ memberId="uniqueId"});
    },

     defaultValue: function () {
         return Payments.find({memberId="uniqueId"});
    },

},

// The code for payments collection

 PaymentSchema = new SimpleSchema({
name:{
    type: String

},
amount:{
    type: String
},
memberId:{
    type: String
},


});

此代码无效。

您似乎缺少架构属性。任何自动表单都需要接受一个架构属性,该属性明确告诉自动表单使用该架构生成必要的表单。检查 this 分页以获取使用自动表单的演示。

{{> quickForm collection="theMongoCollection" id="theFormID" schema="theSchemaName" type="typeOfForm" }}