Add tests for mongoose child schema

Fixes #20331
This commit is contained in:
simonxca
2017-11-13 21:06:55 -08:00
parent 405c41285d
commit 2a5a4ff2fd
+8 -2
View File
@@ -385,8 +385,14 @@ Animal['findByName']('fido', function(err: any, animals: any) {
animalSchema.virtual('name.full').get(function () {
return this.name.first + ' ' + this.name.last;
});
new mongoose.Schema({
child: { name: String }
var childSchema = new mongoose.Schema({ name: String });
var parentSchema = new mongoose.Schema({
children: [childSchema],
child: childSchema,
name: {
index: true,
required: true
}
});
new mongoose.Schema({
eggs: {