Python Motor vs Pymongo
Posté 2023-07-12 21:04:17
0
14KB
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.
Rechercher
Catégories
- Arts
- Business
- Computers
- Jeux
- Health
- Domicile
- Kids and Teens
- Argent
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Lire la suite
Agricultural Sciences
Agricultural sciences are a broad, interdisciplinary field that encompasses parts of the exact,...
Toy Story. (1995)
A cowboy doll is profoundly threatened and jealous when a new spaceman action figure supplants...
How does dehydration affect memory?
The mind is not a warehouse, and it is certainly not a hard drive. We operate under the...
How to make the brain work 100 percent at any age
For a long time, there was a hypothesis that, getting involved in any work, we use only 10% of...
BRIC TV. Live TV.
Brooklyn Community Access Television (BCAT TV Network) is the Public, educational, and government...