elasticio / casbin-mongoose-adapter

Mongoose adapter for Casbin
Apache License 2.0
15 stars 3 forks source link

[Feature Request] Reuse existing mongoose connection #3

Open ulanmurzatayev opened 5 years ago

ulanmurzatayev commented 5 years ago

I think it makes sense to give this adapter ability to reuse existing mongoose connection during creation, because it usually already exists in the application using this adapter.

ghaiklor commented 5 years ago

The point behind using a separate mongoose connection pool is compatibility. In case, there is some consumer that uses a really old mongoose version, it can be not compatible with the features I am using here in the adapter.

If you have any ideas on how to move mongoose in peerDependencies - feel free to open the PR.

BTW, we actually, can move mongoose in peerDependencies and a question of compatibility leave to the consumer of the library.