Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use of deprecated count() #3

Closed
mario-merino opened this issue Feb 5, 2019 · 1 comment
Closed

use of deprecated count() #3

mario-merino opened this issue Feb 5, 2019 · 1 comment

Comments

@mario-merino
Copy link

mario-merino commented Feb 5, 2019

DeprecationWarning: collection.count is deprecated, and will be removed in a future version. Use collection.countDocuments or collection.estimatedDocumentCount instead

I tested just changing line 13 of index from:
const count = await constructor.count(query);
to:
const count = await constructor.countDocuments(query);
and it fixed the warning message (as per guidelines of mongoose herehttps://mongoosejs.com/docs/deprecations.html

@niftylettuce
Copy link
Contributor

Please use mongoose-slug-plugin newest version 2.0.0:

npm install mongoose-slug-plugin@latest

Versions older than v2.0.0 have the following deprecation message now upon installation:

"If you upgrade to v2.0.0+ please ensure you are using Mongoose v5.2+ or greater"

Any issues please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants