Skip to content

Commit

Permalink
test(schema): repro #9429
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 24, 2020
1 parent b128c9b commit a1506cb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2497,4 +2497,13 @@ describe('schema', function() {
assert.equal(schematype.options.min, 4);
assert.equal(schematype.options.get, get);
});

it('applies correct schema to nested primitive arrays (gh-9429)', function() {
const schema = new Schema({
ids: [[{ type: 'ObjectId', required: true }]]
});

const casted = schema.path('ids').cast([[]]);
assert.equal(casted[0].$path(), 'ids.$');
});
});

0 comments on commit a1506cb

Please sign in to comment.