mongodb-developer / pymongo-fastapi-crud

PyMongo with FastAPI CRUD application
Apache License 2.0
131 stars 46 forks source link

FastAPI is async, so this app must use Motor, not PyMongo #5

Open judy2k opened 1 year ago

judy2k commented 1 year ago

PyMongo is blocking, and is thus incompatible with FastAPI, which is asynchronous. Any long-running queries running in a single endpoint will block every other operation until it is complete.

A (relatively straightforward) switch to Motor should fix this issue.