Skip to content

Commit

Permalink
Remove unused code, we don't support Mongoose <5
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanel committed Jun 13, 2023
1 parent a7f2b77 commit 92930c0
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@ module.exports = function (schema, options) {
if (['count', 'countDocuments', 'find', 'findOne'].indexOf(method) > -1) {
var modelMethodName = method;

// countDocuments do not exist in Mongoose v4
/* istanbul ignore next */
if (mongooseMajorVersion < 5 && method === 'countDocuments' && typeof Model.countDocuments !== 'function') {
modelMethodName = 'count';
}

schema.statics[method] = function () {
var query = Model[modelMethodName].apply(this, arguments);
if (!arguments[2] || arguments[2].withDeleted !== true) {
Expand Down

0 comments on commit 92930c0

Please sign in to comment.