pymongo-fastapi-crud icon indicating copy to clipboard operation
pymongo-fastapi-crud copied to clipboard

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

Open judy2k opened this issue 1 year ago • 0 comments

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.

judy2k avatar Aug 10 '23 15:08 judy2k