Skip to content

Commit 4c150e0

Browse files
committed
test(model): repro #8343
1 parent 3e9faef commit 4c150e0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/model.indexes.test.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,15 @@ describe('model', function() {
104104
});
105105
});
106106

107-
it('of embedded documents unless excludeIndexes (gh-5575)', function(done) {
108-
const BlogPost = new Schema({
109-
_id: {type: ObjectId},
110-
title: {type: String, index: true},
107+
it('of embedded documents unless excludeIndexes (gh-5575) (gh-8343)', function(done) {
108+
const BlogPost = Schema({
109+
_id: { type: ObjectId },
110+
title: { type: String, index: true },
111111
desc: String
112112
});
113+
const otherSchema = Schema({
114+
name: { type: String, index: true }
115+
}, { excludeIndexes: true })
113116

114117
const User = new Schema({
115118
name: {type: String, index: true},
@@ -121,7 +124,8 @@ describe('model', function() {
121124
blogpost: {
122125
type: BlogPost,
123126
excludeIndexes: true
124-
}
127+
},
128+
otherArr: [otherSchema]
125129
});
126130

127131
const UserModel = db.model('gh5575', User);

0 commit comments

Comments
 (0)