Answer the question
In order to leave comments, you need to log in
Mongoose how to get property of related object by its id?
There is a model GenreModel which contains two properties: _id
(created automatically) and genre_name
string type.
There is a Games model that contains:
game_name: { type: String, required: true, index: true},
game_genre: {type: mongoose.Schema.Types.ObjectId, ref: 'GenreModel', required: true }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question