我正在使用 SimpleSchema 和 Meteor 来构建数据库条目。
问题是,我有一组对象数组(这些数据显示在 HTML 表中)并且需要更新单个单元格。
我的架构看起来像:(Coffeescript)
drags:
type: [[Object]]
label: "The correct assignment of drop values"
optional: true
blackbox: true
"drags.$":
type: [Object]
label: "Row of the Table"
blackbox: true
"drags.$.$":
type: Object
label: "Cell of the Table"
"drags.$.$._id":
type: String
label: "Unique Id of Draggable"
optional: true
"drags.$.$.text":
type: String
label: "Text of Draggable"
optional: true
"drags.$.$.fixed":
type: Boolean
label: "Is this Draggable Fixed to the correct spot"
optional: true
"drags.$.$.color":
type: String
label: "Color of Draggable"
optional: true
我更新特定单元格的数据库调用是:
db.update({_id:"some-id"},{$set: {"drags.1.2.fixed":true}})
此调用引发此错误:
Error: When the modifier option is true, validation object must have at least one operator