MongoEngine and FastAPI: sessions via dependency injection?

21 views
Skip to first unread message

Erik Williamson

unread,
Feb 10, 2022, 12:55:38 PMFeb 10
to MongoEngine Users
Hi All,

I'm working on a new project that uses MongoEngine with FastAPI. There's not much online  for reference; it seems like it may be an unpopular combination. However:

I see that people use dependency injection when using FastAPI with RDBMSs - so for each endpoint called it will inject a DB session to be used for that endpoint. Is that necessary when using MongoEngine? It doesn't seem to be, but I wanted to be sure before I go too far down this road.

Thanks,
Erik.

Reply all
Reply to author
Forward
0 new messages