I'm using autoform for meteor. I have an array of nested schemas, like so:
addresses: {
type: [Schemas.address],
optional: true,
defaultValue: []
}
and I'm attempting to add an address to the array using update-pushArray
{{> quickForm id="myformid" type="update-pushArray" doc=getDocument collection=getCollection scope="addresses"}}
But I'm getting these gems:
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]"
So I tried wrapping it in an array in a formToDoc hook:
SimpleSchema.clean: filtered out value that would have affected key "0", which is not allowed by the schema
So... yeah. That's the limit of my fresh ideas. What do you have?