Array elements gets truncated
DeanKamali opened this issue · comments
Deano commented
Hello everyone,
I'm trying to save an Array, and here is an example
"procedures": [
"AK",
"HI"
],
In Schema file, here is what I specified
procedures: {
type: Array
},
it gets saved as an empty array? and none of the elements makes it to DB, why is that?
Deano commented
hmm, after struggle, I found out that I need to do the following:
procedures: SimpleSchema.oneOf(String, Array),
'procedures.$': { type: String, optional: true, },