Skip to content

Commit a0f423f

Browse files
Mattchewonedaffl
authored andcommitted
Updated to remove the deprecated .count (#250)
* Updated to remove the deprecated .count Replaced with the faster version `estimatedDocumentCount` * Updated to latest mongoose * Adding peerDependency
1 parent 7bccf69 commit a0f423f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Service {
9898
}
9999

100100
if (count) {
101-
return model.where(query).count().exec().then(executeQuery);
101+
return model.where(query).estimatedDocumentCount().exec().then(executeQuery);
102102
}
103103

104104
return executeQuery();

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
"directories": {
5757
"lib": "lib"
5858
},
59+
"peerDependencies": {
60+
"mongoose": "^5.2.5"
61+
},
5962
"dependencies": {
6063
"@feathersjs/commons": "^1.3.0",
6164
"@feathersjs/errors": "^3.2.0",
@@ -71,7 +74,7 @@
7174
"feathers-service-tests": "^0.10.0",
7275
"istanbul": "^1.1.0-alpha.1",
7376
"mocha": "^5.0.0",
74-
"mongoose": "^5.0.0",
77+
"mongoose": "^5.2.5",
7578
"semistandard": "^12.0.0",
7679
"sinon-chai": "^3.0.0",
7780
"sinon": "^6.0.0"

0 commit comments

Comments
 (0)