Skip to content

feat: Support for reusing existing MongoDB client #9

@omseervi098

Description

@omseervi098

Currently, casbin_pymongo_adapter always creates a new MongoDB client by parsing the connection URL internally. This makes it difficult to reuse an already-initialized MongoClient that may be shared across the application.

Allow passing an existing MongoClient as an optional argument to the adapter, for example:
adapter= Adapter(client=mongo_client, db_name="casbin")

while keeping existing one

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions