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
Mental Health
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...
By FWhoop Xelqua 2023-06-23 15:34:54 0 29K
Mental Health
Schizophrenia Diagnosis and Comorbidities
CriteriaSchizophrenia is diagnosed based on criteria in either the Diagnostic and Statistical...
By Kelsey Rodriguez 2023-02-02 16:14:08 0 12K
Business
Aristotle is the most influential person in philosophy.
Aristotle is the most influential person in philosophy. Aristotle is the most influential...
By Leonard Pokrovski 2024-07-24 12:42:33 0 15K
Социальные проблемы
Пила: Спираль. Spiral: From the Book of Saw. (2021)
Импульсивный детектив полиции Нью-Йорка Зик Бэнкс всю жизнь пытается вырваться из тени отца,...
By Nikolai Pokryshkin 2022-09-12 21:35:35 1 28K
Financial Services
The structure of costs in the long run
Key points A production technology is the specific combination of labor,...
By Mark Lorenzo 2023-07-14 18:27:19 0 14K

BigMoney.VIP Powered by Hosting Pokrov