I'm trying to $set
a multidimensional array of objects ("log
") in Meteor on the server side. Every time I do the operation, the objects all appear as null
after the update. I suspect it might be a problem with my SimpleSchema, but I can't find any answers on how to do it properly. At worst, since it's all generated by the server, is there any way I can just disable verification of this field entirely in SimpleSchema?
Example update:
{ $set: {
log: [
[
[{
"event": "ability",
"sourceId": "Attack",
"result": true,
"timestamp": "2015-12-01T09:11:07.465Z",
"selfId": "p2",
"targetId": "e1"
}, {
"event": "effect",
"sourceId": "dealBaseDamage",
"result": 7,
"timestamp": "2015-12-01T09:11:07.467Z",
"selfId": "p2",
"targetId": "e1"
}],
[]
]
]
} }
And this gives the following result in the database after the operation:
"log": [
[
[
null,
null
],
[]
]
]
My schema is as follows:
log: {
type: Array,
},
'log.$': {
type: Array,
},
'log.$.$': {
type: [Object],
optional: true,
blackbox: true
}
I've also tried this:
log: {
type: Array,
},
'log.$': {
type: Array,
},
'log.$.$': {
type: Array
},
'log.$.$.$': {
type: Object,
optional: true,
blackbox: true
}