Python Motor vs Pymongo
نشر بتاريخ 2023-07-12 21:04:17
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.
البحث
الأقسام
- Arts
- Business
- Computers
- الألعاب
- Health
- الرئيسية
- Kids and Teens
- مال
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
إقرأ المزيد
Do I Need a Website to Start Affiliate Marketing?
When people first hear about affiliate marketing, their assumption is often that they’ll...
10 "MarketPlace" platforms through which you can sell your goods in the USA
As you know, the United States is a very developed country, in which most people make purchases...
ADHD: History
Hyperactivity has long been part of the human condition. Sir Alexander Crichton describes "mental...
Do You Need to Be in Silicon Valley to Succeed in Tech?
For decades, Silicon Valley has been the global epicenter of technological innovation. Home to...
What Is the Difference Between E-commerce and Traditional Commerce?
What Is the Difference Between E-commerce and Traditional Commerce?
Commerce is simply the...