Skip to content

Commit

Permalink
test(query): repro #9973
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Mar 10, 2021
1 parent 5277d24 commit 6c429ad
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/services.query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,24 @@ describe('Query helpers', function() {

done();
});

it('handles paths selected with elemMatch (gh-9973)', function(done) {
const schema = new Schema({
name: String,
arr: [{ el: String }]
});

const q = new Query({});
q.schema = schema;

assert.strictEqual(q._fields, void 0);

q.select({ 'arr.$': 1 });
q.populate('arr.el');
selectPopulatedFields(q);
assert.deepEqual(q._fields, { 'arr.$': 1 });

done();
});
});
});

0 comments on commit 6c429ad

Please sign in to comment.