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

Add support + doc example for using mongita with MongoDB backend #715

Open
JWCook opened this issue Oct 24, 2022 · 0 comments
Open

Add support + doc example for using mongita with MongoDB backend #715

JWCook opened this issue Oct 24, 2022 · 0 comments
Labels
blocked This is currently blocked by issues beyond the scope of this project docs Documentation and examples enhancement

Comments

@JWCook
Copy link
Member

JWCook commented Oct 24, 2022

mongita looks like a nice alternative MongoDB client that uses local storage only, with no server setup required (similar to redislite for the Redis backend). It would be nice to add an example to the docs on how to use with with the requests-cache MongoDB backend (and possibly some small compatibility changes on this end).

After testing this out, it looks like at least a couple upstream changes would be required:

If those were taken care of, I believe using requests-cache with mongita would just look like:

from mongita import MongitaClientDisk
from requests_cache import CachedSession, MongoCache

backend = MongoCache(connection=MongitaClientDisk())
session = CachedSession(backend=backend)
@JWCook JWCook added enhancement docs Documentation and examples labels Oct 24, 2022
@JWCook JWCook added the blocked This is currently blocked by issues beyond the scope of this project label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This is currently blocked by issues beyond the scope of this project docs Documentation and examples enhancement
Projects
None yet
Development

No branches or pull requests

1 participant