For example I have two models in mongoose:
var Persona = {
nombre: "Luis",
carros:{
type: Schema.ObjectId,
ref:'Carro'
},
apellidos:"Colx Redex"
}
var Carro = {
modelo:"FX-200",
velocidad:"300km/h",
marca:"Nissan"
}
Then how do I search the person model but also include the car model ... example:
Persona.find({persona.carros.marca: "Nissan"}, function(err, docs){
});
When what is actually stored in the Persona model is only the ObjectId ("5b93f9ee75323d09084af622") of the car ....
I hope any help, thank you very much !!