init_beanie with mongo session instead of database instance #976
resulyrt93
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey team,
We need to initialize beanie instance with mongodb session instead of database instance. Thus we can initialize a real mongodb instance in the tests and we want to use following approach for reuseability.
source: https://www.mongodb.com/developer/products/mongodb/pytest-fixtures-and-pypi/
I've used
SessionMethods
but it didn't work. Is there any workaround way to provide session instance globally? Setting the session in all.find()
,.update()
etc. operations causes big refactoring effort for now :(Beta Was this translation helpful? Give feedback.
All reactions