我正在使用自动生成流星。我有一组嵌套模式,如下所示:
addresses: {
type: [Schemas.address],
optional: true,
defaultValue: []
}
我正在尝试使用向数组添加地址update-pushArray
{{> quickForm id="myformid" type="update-pushArray" doc=getDocument collection=getCollection scope="addresses"}}
但我得到了这些宝石:
MinimongoError: Cannot apply $push modifier to non-array
"MongoError: The field 'addresses' must be an array but is of type Object in document {_id: "383EfPJgeZQJFgs72"} [409]"
所以我尝试将它包装在一个formToDoc
钩子中的数组中:
SimpleSchema.clean: filtered out value that would have affected key "0", which is not allowed by the schema
是的。这就是我新鲜想法的极限。你有什么?