Permalink
Browse files

test: repro #4866

  • Loading branch information...
1 parent 075213f commit ab680e4c15aba3a27bcb3625c2dabc96b22fe18e @vkarpov15 vkarpov15 committed Jan 12, 2017
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/aggregate.test.js
@@ -700,4 +700,19 @@ describe('aggregate: ', function() {
done();
});
});
+
+ it('query by document (gh-4866)', function(done) {
+ var db = start();
+
+ var MyModel = db.model('gh4866', {
+ name: String
+ });
+
+ MyModel.create({ name: 'test' }).
+ then(function(doc) { return MyModel.aggregate([{ $match: doc }]); }).
+ then(function() {
+ done();
+ }).
+ catch(done);
+ });
});

0 comments on commit ab680e4

Please sign in to comment.