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
Ужасы
Дальний космос. Stowaway (2021)
Экипаж космического корабля, направляющегося на Марс, обнаруживает на борту случайного пассажира...
By Nikolai Pokryshkin 2022-09-18 22:13:39 0 64K
Marketing and Advertising
How Do Referrals Help Customer Acquisition?
Referral-based customer acquisition is one of the most powerful—and often...
By Dacey Rankins 2026-01-19 15:21:52 0 2K
Business
Promising business in 2024
It will be possible to open a business and run it successfully, given the situation on the market...
By Dacey Rankins 2024-03-11 17:50:24 0 28K
Paper and Pencil
How to Play Battleship
An exciting "battle" will help to brighten up the wait or have fun. We will tell you how to play...
By Dacey Rankins 2024-04-05 19:46:24 0 13K
Organizations
The Backbone of Sports Excellence: A Look into Sports Organizations
The Backbone of Sports Excellence: A Look into Sports Organizations Sports organizations serve...
By Leonard Pokrovski 2024-07-03 00:17:55 0 26K

BigMoney.VIP Powered by Hosting Pokrov