如题。vote下有一个对象属性ActionSchema。我想访问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']);