Skip to content

Commit

Permalink
changed .count to .countDocuments. Because .count is deprecated and w…
Browse files Browse the repository at this point in the history
…ill be removed in future versions. And it's raising flags when being used. (mongoose-unique-validator#84)
  • Loading branch information
tanvirrb authored and viveleroi committed Jul 19, 2018
1 parent dbaad90 commit 785fa2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = function(schema, options) {
model = this.model(this.constructor.modelName);
}

model.where({ $and: conditions }).count((err, count) => {
model.where({ $and: conditions }).countDocuments((err, count) => {
resolve(count === 0);
});
});
Expand Down

0 comments on commit 785fa2f

Please sign in to comment.