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. (#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
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

2 comments on commit 785fa2f

@shahruz
Copy link

@shahruz shahruz commented on 785fa2f Aug 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this commit going to get tagged for release? 2.0.1 on NPM still has the deprecated call.

@viveleroi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing, so I need to figure out what's breaking first.

Please sign in to comment.