mongoose-paginate-v2
Advanced tools
Comparing version 1.3.15 to 1.3.16
# Changelog | ||
## v1.3.16 | ||
[2021-02-24] | ||
- Collation fix for MongoDB v3.4 and less. | ||
## v1.3.15 | ||
@@ -4,0 +10,0 @@ |
@@ -125,3 +125,8 @@ "use strict"; | ||
// Deprecated since starting from MongoDB Node.JS driver v3.1 | ||
countPromise = this.count(query).collation(collation).exec(); | ||
// Hack for mongo < v3.4 | ||
if (Object.keys(collation).length > 0) { | ||
countPromise = this.count(query).collation(collation).exec(); | ||
} else { | ||
countPromise = this.count(query).exec(); | ||
} | ||
} else { | ||
@@ -133,3 +138,8 @@ if (useEstimatedCount === true) { | ||
} else { | ||
countPromise = this.countDocuments(query).collation(collation).exec(); | ||
// Hack for mongo < v3.4 | ||
if (Object.keys(collation).length > 0) { | ||
countPromise = this.countDocuments(query).collation(collation).exec(); | ||
} else { | ||
countPromise = this.countDocuments(query).exec(); | ||
} | ||
} | ||
@@ -136,0 +146,0 @@ } |
{ | ||
"name": "mongoose-paginate-v2", | ||
"version": "1.3.15", | ||
"version": "1.3.16", | ||
"description": "A cursor based custom pagination library for Mongoose with customizable labels.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -120,3 +120,9 @@ /** | ||
// Deprecated since starting from MongoDB Node.JS driver v3.1 | ||
countPromise = this.count(query).collation(collation).exec(); | ||
// Hack for mongo < v3.4 | ||
if (Object.keys(collation).length > 0) { | ||
countPromise = this.count(query).collation(collation).exec(); | ||
} else { | ||
countPromise = this.count(query).exec(); | ||
} | ||
} else { | ||
@@ -128,3 +134,8 @@ if (useEstimatedCount === true) { | ||
} else { | ||
countPromise = this.countDocuments(query).collation(collation).exec(); | ||
// Hack for mongo < v3.4 | ||
if (Object.keys(collation).length > 0) { | ||
countPromise = this.countDocuments(query).collation(collation).exec(); | ||
} else { | ||
countPromise = this.countDocuments(query).exec(); | ||
} | ||
} | ||
@@ -131,0 +142,0 @@ } |
283789
973