Answer the question
In order to leave comments, you need to log in
How to query nested array with Mongoose?
There is a model
var RequestSchema = new Schema({
requestNumber: {
type: String
},
requestDescription: {
type: String,
required: [true, 'Необходимо добавить описание']
},
orders: [{
product: {
type: Schema.Types.ObjectId,
ref: 'Product',
required: true
},
finishTo: {
type: Date,
required: true
}
}],
createdAt: {
default: Date.now,
type: Date
}
});
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