Motor Features

Warning

Motor will be deprecated on May 14th, 2026, one year after the production release of the PyMongo Async driver. Critical bug fixes will be made until May 14th, 2027. We strongly recommend that Motor users migrate to the PyMongo Async driver while Motor is still supported. To learn more, see the migration guide.

Non-Blocking

Motor is an asynchronous driver for MongoDB. It can be used from Tornado or asyncio applications. Motor never blocks the event loop while connecting to MongoDB or performing I/O.

Featureful

Motor wraps almost all of PyMongo’s API and makes it non-blocking. For the few PyMongo features not implemented in Motor, see Differences between Motor and PyMongo.

Convenient With tornado.gen

The tornado.gen module lets you use coroutines to simplify asynchronous code. Motor methods return Futures that are convenient to use with coroutines.

Configurable IOLoops

Motor supports Tornado applications with multiple IOLoops. Pass the io_loop argument to MotorClient to configure the loop for a client instance.

Streams Static Files from GridFS

Motor can stream data from GridFS to a Tornado RequestHandler using stream_to_handler() or the GridFSHandler class. It can also serve GridFS data with aiohttp using the AIOHTTPGridFS class.