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

Deprecation warning - ensureIndex is deprecated. #51

Closed
sapcik opened this issue Jan 28, 2022 · 4 comments · Fixed by #52
Closed

Deprecation warning - ensureIndex is deprecated. #51

sapcik opened this issue Jan 28, 2022 · 4 comments · Fixed by #52
Assignees
Labels
bug Something isn't working

Comments

@sapcik
Copy link

sapcik commented Jan 28, 2022

Hi,

I'm getting following warning:

(node:42970) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
at NativeCollection. [as ensureIndex] (/project/node_modules/casbin-mongoose-adapter/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:244:33)
at NativeCollection.create (/project/node_modules/casbin-mongoose-adapter/node_modules/mongoose/lib/model.js:1753:33)

Here is a list of libraries that I'm using:

  1. casbin: "^5.11.5",
  2. casbin-mongoose-adapter: "^3.1.1",
  3. mongoose: "^6.0.12",

Please, can it be upgraded to work with a newer version of mongoose/mongo?

As far as I understand, string ensureIndex should be replaced by createIndexes in lib/model.js

Thanks,
Wojciech

@casbin-bot
Copy link

@casbin-bot casbin-bot added the question Further information is requested label Jan 28, 2022
@hsluoyz
Copy link
Member

hsluoyz commented Jan 28, 2022

@fabian4

@hsluoyz hsluoyz added bug Something isn't working and removed question Further information is requested labels Jan 28, 2022
@hsluoyz
Copy link
Member

hsluoyz commented Jan 29, 2022

@sapcik
Copy link
Author

sapcik commented Feb 1, 2022

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants