Skip to content

Commit

Permalink
test(schema): repro #10644
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 1, 2021
1 parent 57540aa commit d21d2b1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/schema.test.js
Expand Up @@ -2652,4 +2652,17 @@ describe('schema', function() {
assert.equal(TestSchema.path('testprop.$*').instance, 'Number');
assert.equal(TestSchema.path('testprop.$*').options.ref, 'OtherModel');
});

it('handles maps of maps (gh-10644)', function() {
const schema = new mongoose.Schema({
myMap: {
type: Map,
of: {
type: Map,
of: String
}
}
});
assert.equal(schema.path('myMap').$__schemaType.$__schemaType.instance, 'String');
});
});

0 comments on commit d21d2b1

Please sign in to comment.