Python Motor vs Pymongo
Posted 2023-07-12 21:04:17
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
- Arts
- Business
- Computers
- Jocuri
- Health
- Home
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Citeste mai mult
How Do You Set Up and Run Effective CRO Tests?
Conversion Rate Optimization (CRO) is as much a science as it is an art. The science comes from...
What Is Guerrilla Marketing? Definition, Core Principles, and Modern Applications
Introduction
Marketing has always been about grabbing attention — but in today’s...
The most read books in the world
Top 100 best-selling individual books and book series worldwide for all time.
This list is...
Essential Tools and Technologies to Support Effective Business Development
Business development (BD) is a multifaceted discipline that requires strategy, relationships,...
What Kind of Insurance Do I Need?
When it comes to protecting your assets, securing the right kind of insurance is vital for...