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
Business
Tools for analytics and sales management on marketplaces
In recent years, marketplaces have become an important part of sales strategies for many...
By Dacey Rankins 2024-09-13 19:20:46 0 15K
Business
What Are the Main Responsibilities of a CEO?
The Chief Executive Officer (CEO) is the highest-ranking executive in a company, responsible for...
By Dacey Rankins 2025-06-13 17:36:25 0 8K
Social Issues
Smoking Barrels. (1998)
Eddy persuades his three pals to pool money for a vital poker game against a powerful local...
By Leonard Pokrovski 2023-03-05 18:37:17 0 21K
Жизненные вопросы
Шоу Трумана. The Truman Show. (1998)
Представьте себе, что вы вдруг начинаете понимать, что все вокруг вас — декорации, а люди...
By Nikolai Pokryshkin 2023-02-12 13:06:25 0 23K
Television
Pittsburgh Faith & Family. Live TV.
The Pittsburgh Faith & Family Channel brings the truth of the Good News directly into your...
By Nikolai Pokryshkin 2022-11-20 20:58:51 0 37K

BigMoney.VIP Powered by Hosting Pokrov