Motor Tornado API¶
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.
MotorClient– Connection to MongoDBMotorClientMotorClient.bulk_write()MotorClient.drop_database()MotorClient.get_database()MotorClient.get_default_database()MotorClient.list_database_names()MotorClient.list_databases()MotorClient.server_info()MotorClient.start_session()MotorClient.watch()MotorClient.HOSTMotorClient.PORTMotorClient.addressMotorClient.arbitersMotorClient.closeMotorClient.codec_optionsMotorClient.is_mongosMotorClient.is_primaryMotorClient.nodesMotorClient.optionsMotorClient.primaryMotorClient.read_concernMotorClient.read_preferenceMotorClient.secondariesMotorClient.topology_descriptionMotorClient.write_concern
MotorClientSession– Sequence of operationsMotorClientSessionMotorClientSession.abort_transaction()MotorClientSession.commit_transaction()MotorClientSession.end_session()MotorClientSession.start_transaction()MotorClientSession.with_transaction()MotorClientSession.advance_cluster_timeMotorClientSession.advance_operation_timeMotorClientSession.clientMotorClientSession.cluster_timeMotorClientSession.has_endedMotorClientSession.in_transactionMotorClientSession.operation_timeMotorClientSession.optionsMotorClientSession.session_id
MotorDatabaseMotorDatabaseMotorDatabase.aggregate()MotorDatabase.command()MotorDatabase.create_collection()MotorDatabase.cursor_command()MotorDatabase.dereference()MotorDatabase.drop_collection()MotorDatabase.get_collection()MotorDatabase.list_collection_names()MotorDatabase.list_collections()MotorDatabase.validate_collection()MotorDatabase.watch()MotorDatabase.with_options()MotorDatabase.clientMotorDatabase.codec_optionsMotorDatabase.nameMotorDatabase.read_concernMotorDatabase.read_preferenceMotorDatabase.write_concern
MotorCollectionMotorCollectionMotorCollection.databaseMotorCollection.aggregate()MotorCollection.aggregate_raw_batches()MotorCollection.bulk_write()MotorCollection.count_documents()MotorCollection.create_index()MotorCollection.create_indexes()MotorCollection.create_search_index()MotorCollection.create_search_indexes()MotorCollection.delete_many()MotorCollection.delete_one()MotorCollection.distinct()MotorCollection.drop()MotorCollection.drop_index()MotorCollection.drop_indexes()MotorCollection.drop_search_index()MotorCollection.estimated_document_count()MotorCollection.find()MotorCollection.find_one()MotorCollection.find_one_and_delete()MotorCollection.find_one_and_replace()MotorCollection.find_one_and_update()MotorCollection.find_raw_batches()MotorCollection.index_information()MotorCollection.insert_many()MotorCollection.insert_one()MotorCollection.list_indexes()MotorCollection.list_search_indexes()MotorCollection.options()MotorCollection.rename()MotorCollection.replace_one()MotorCollection.update_many()MotorCollection.update_one()MotorCollection.update_search_index()MotorCollection.watch()MotorCollection.with_options()MotorCollection.codec_optionsMotorCollection.full_nameMotorCollection.nameMotorCollection.read_concernMotorCollection.read_preferenceMotorCollection.write_concern
MotorChangeStreamMotorClientEncryptionMotorClientEncryptionMotorClientEncryption.add_key_alt_name()MotorClientEncryption.close()MotorClientEncryption.create_data_key()MotorClientEncryption.create_encrypted_collection()MotorClientEncryption.decrypt()MotorClientEncryption.delete_key()MotorClientEncryption.encrypt()MotorClientEncryption.encrypt_expression()MotorClientEncryption.get_key()MotorClientEncryption.get_key_by_alt_name()MotorClientEncryption.remove_key_alt_name()MotorClientEncryption.rewrap_many_data_key()
MotorCursorMotorCursorMotorCursor.add_option()MotorCursor.allow_disk_use()MotorCursor.clone()MotorCursor.close()MotorCursor.collation()MotorCursor.comment()MotorCursor.distinct()MotorCursor.each()MotorCursor.explain()MotorCursor.hint()MotorCursor.limit()MotorCursor.max()MotorCursor.max_await_time_ms()MotorCursor.max_scan()MotorCursor.max_time_ms()MotorCursor.min()MotorCursor.next()MotorCursor.next_object()MotorCursor.remove_option()MotorCursor.rewind()MotorCursor.skip()MotorCursor.sort()MotorCursor.to_list()MotorCursor.where()MotorCursor.addressMotorCursor.aliveMotorCursor.cursor_idMotorCursor.fetch_nextMotorCursor.session
MotorCommandCursorMotorCommandCursorMotorCommandCursor.close()MotorCommandCursor.each()MotorCommandCursor.next()MotorCommandCursor.next_object()MotorCommandCursor.to_list()MotorCommandCursor.try_next()MotorCommandCursor.addressMotorCommandCursor.aliveMotorCommandCursor.cursor_idMotorCommandCursor.fetch_nextMotorCommandCursor.session
- Motor GridFS Classes
MotorGridFSBucketMotorGridFSBucket.delete()MotorGridFSBucket.download_to_stream()MotorGridFSBucket.download_to_stream_by_name()MotorGridFSBucket.find()MotorGridFSBucket.open_download_stream()MotorGridFSBucket.open_download_stream_by_name()MotorGridFSBucket.open_upload_stream()MotorGridFSBucket.open_upload_stream_with_id()MotorGridFSBucket.rename()MotorGridFSBucket.upload_from_stream()MotorGridFSBucket.upload_from_stream_with_id()
MotorGridInMotorGridIn.abort()MotorGridIn.close()MotorGridIn.set()MotorGridIn.write()MotorGridIn.writelines()MotorGridIn.chunk_sizeMotorGridIn.closedMotorGridIn.content_typeMotorGridIn.filenameMotorGridIn.lengthMotorGridIn.nameMotorGridIn.readMotorGridIn.readableMotorGridIn.seekableMotorGridIn.upload_dateMotorGridIn.writeable
MotorGridOutMotorGridOut.open()MotorGridOut.read()MotorGridOut.readchunk()MotorGridOut.readline()MotorGridOut.stream_to_handler()MotorGridOut.aliasesMotorGridOut.chunk_sizeMotorGridOut.closeMotorGridOut.content_typeMotorGridOut.filenameMotorGridOut.lengthMotorGridOut.metadataMotorGridOut.nameMotorGridOut.readableMotorGridOut.seekMotorGridOut.seekableMotorGridOut.tellMotorGridOut.upload_dateMotorGridOut.write
MotorGridOutCursorMotorGridOutCursor.allow_disk_use()MotorGridOutCursor.clone()MotorGridOutCursor.close()MotorGridOutCursor.collation()MotorGridOutCursor.comment()MotorGridOutCursor.distinct()MotorGridOutCursor.each()MotorGridOutCursor.explain()MotorGridOutCursor.hint()MotorGridOutCursor.limit()MotorGridOutCursor.max()MotorGridOutCursor.max_await_time_ms()MotorGridOutCursor.max_scan()MotorGridOutCursor.max_time_ms()MotorGridOutCursor.min()MotorGridOutCursor.next()MotorGridOutCursor.next_object()MotorGridOutCursor.rewind()MotorGridOutCursor.skip()MotorGridOutCursor.sort()MotorGridOutCursor.to_list()MotorGridOutCursor.where()MotorGridOutCursor.addressMotorGridOutCursor.aliveMotorGridOutCursor.cursor_idMotorGridOutCursor.fetch_nextMotorGridOutCursor.session
motor.web- Integrate Motor with the Tornado web framework
See also
This page describes using Motor with Tornado. For asyncio integration, see Motor asyncio API.