ladjs / mongoose-slug-plugin

Slugs for Mongoose with history and i18n support (uses speakingurl by default, but you can use any slug library such as limax, slugify, mollusc, or slugme)
https://lad.js.org
MIT License
22 stars 9 forks source link

update index.js to address deprecation warning #4

Closed mario-merino closed 5 years ago

codecov[bot] commented 5 years ago

Codecov Report

Merging #4 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #4   +/-   ##
=======================================
  Coverage   81.25%   81.25%           
=======================================
  Files           1        1           
  Lines          48       48           
=======================================
  Hits           39       39           
  Misses          9        9
Impacted Files Coverage Δ
index.js 81.25% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5e30720...5ba79df. Read the comment docs.

niftylettuce commented 5 years ago

@vkarpov15 what version of Mongoose was countDocuments added? we may need to do a peerDependency with that particular >= version.

Also I think we are missing this from docs on Mongoose with the count -> countDocuments deprecation:

Note that if you migrate from count to countDocuments where are query operators including, but not limited to $where, $near, and $nearSphere that need replaced. See https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments for more information.

vkarpov15 commented 5 years ago

@niftylettuce 5.2.0: https://github.com/Automattic/mongoose/blob/master/History.md#520--2018-07-02

See docs: https://mongoosejs.com/docs/deprecations.html#-count-

paullbn commented 5 years ago

Hi! Will this PR be merged?

niftylettuce commented 5 years ago

@paullbn yes, just need a min

niftylettuce commented 5 years ago

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.

cc @paullbn