【发布时间】:2013-07-02 01:41:03
【问题描述】:
作为标题。在ActionSchema 下有一个对象属性vote。我想访问vote.type,但是path('vote.type') 不起作用。
ActionSchema = new Schema({
vote: {
type: String
}
});
// TypeError: Cannot call method 'enum' of undefined
ActionSchema.path('vote.type').enum(['upvote', 'downvote']);
【问题讨论】:
标签: object path schema mongoose