Python Motor vs Pymongo

0
13K

Motor provides a single client class, MotorClient. Unlike PyMongo’s MongoClient, Motor’s client class does not begin connecting in the background when it is instantiated. Instead it connects on demand, when you first attempt an operation.

You should use Motor when you're trying to interact with a MongoDB database in an asynchronous context. When you're making something that needs to be asynchronous (like a web server, or most commonly from what I've seen here, Discord bots), you also want all the database calls to be done asynchronously. But pymongo is synchronous, i.e it is blocking, and will block the execution of your asynchronous program for the time that it is talking to the database.

Căutare
Categorii
Citeste mai mult
Customer Service
Customer Service
Customer service is an essential part of any business, big or small. It is often the first point...
By FWhoop Xelqua 2023-07-25 20:10:12 0 36K
Деньги
Услуги, направленные на привлечение финансового изобилия или улучшение финансового благополучия от Архипокровителя Николая.
1. Денежные заклинания.- Заклинания изобилия: Ритуалы, направленные на проявление богатства и...
By Nikolai Pokrovski 2024-12-19 20:50:32 0 21K
Социальные проблемы
Девушка, подающая надежды. Promising Young Woman. (2020)
Когда-то Кассандра училась в университете и подавала большие надежды, но теперь живёт с...
By Nikolai Pokryshkin 2022-10-03 18:30:57 0 27K
Business
What Should I Focus On to Grow as a Manager?
Growing as a manager involves more than just meeting targets and managing tasks—it’s...
By Dacey Rankins 2025-05-13 16:04:22 0 6K
Environment
Climate Change Mitigation
Climate change is one of the most serious challenges facing humanity. To a large extent, it is...
By FWhoop Xelqua 2022-09-05 09:17:41 0 41K

BigMoney.VIP Powered by Hosting Pokrov