说我有一个类似
的模型/var/log/upstart/gunicorn.log
我尝试使用University.add({
university_id: { type: Types.Number, required: true, initial: true, index: true, unique: true },
name: { type: Types.Text, required: true, index: true },
address: { type: Types.Text, initial: true, required: false, index: false }
});
University.schema.add({
"inner_object": {
"name": String,
"phone": String,
"comment": String
}
});
getUpdateHandler()
我收到错误使用无效字段路径调用的UpdateHandler.process:inner_object.name
如果有人经历了同样的情况,请更新
答案 0 :(得分:0)
你在keystone之外添加了inner_object,直接通过mongoose,这意味着keystone不会知道它的存在。只需将其添加到第一个配置对象:
University.add({
university_id: { type: Types.Number, required: true, initial: true, index: true, unique: true },
name: { type: Types.Text, required: true, index: true },
address: { type: Types.Text, initial: true, required: false, index: false },
inner_object: {
name: {type:String},
phone: {type:String},
comment: {type:String}
}
});