{
.....
country: { type: mongoose.Schema.Types.ObjectId, ref: 'Countries', required: true },
city: { type: mongoose.Schema.Types.ObjectId, ref: 'Countries.cities' }
.....
}
Validation failed: city: Schema hasn't been registered for model "Countries.cities".\nUse mongoose.model(name, schema)
{
.....
country: { type: mongoose.Schema.Types.ObjectId, ref: 'Countries', required: true },
city: { type: mongoose.Schema.Types.ObjectId, ref: 'Countries.cities' }
.....
}
Validation failed: city: Schema hasn't been registered for model "Countries.cities".\nUse mongoose.model(name, schema)