Python Motor vs Pymongo

0
14Кб

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.

Поиск
Категории
Больше
Customer Service
What Is Self-Service Customer Support?
Customer service has traditionally relied on direct interactions between customers and service...
От Dacey Rankins 2026-03-13 01:25:14 0 5Кб
Television
National Religious Broadcasters. Live TV. USA.
National Religious Broadcasters (NRB) is an international association of evangelical...
От Nikolai Pokryshkin 2022-10-09 11:41:51 0 27Кб
Спорт
Большой Лебовски. The Big Lebowski. (1998)
Лос-Анджелес, 1991 год, война в Персидском заливе. Главный герой по прозвищу Чувак считает себя...
От Nikolai Pokryshkin 2023-04-12 17:23:30 0 33Кб
Reference
The Significance of References: Building Trust and Credibility
In the vast landscape of academia, employment, and various professional endeavors, references...
От Dacey Rankins 2024-05-16 19:23:54 0 23Кб
Support Groups
SUPPORT TEAM FOR YOUR SELLERS
Even the best sellers in the world can not go out - they need a support group that will remove...
От FWhoop Xelqua 2023-03-20 18:27:32 0 22Кб

BigMoney.VIP Powered by Hosting Pokrov