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
Journals
Unlocking the Power of Journal References: A Comprehensive Guide
Unlocking the Power of Journal References: A Comprehensive Guide In...
By Leonard Pokrovski 2024-05-18 18:56:11 0 17K
Contests
Contemporary
  The 5th season of the art competition from the gallery in London. Applications are...
By FWhoop Xelqua 2023-03-11 19:45:33 0 22K
Sport
Million Dollar Baby. (2004)
A determined woman works with a hardened boxing trainer to become a professional. My Link
By Leonard Pokrovski 2023-03-17 19:34:47 0 27K
Business
Form of government
The form of state government is an element of the form of the state, which determines the system...
By Dacey Rankins 2024-09-25 19:18:22 0 33K
Социальные проблемы
Нефть. There Will Be Blood. (2007)
Начало XX века. Предприниматель Дэниэл Плэйнвью ищет золото и серебро, а находит нефть. За...
By Nikolai Pokryshkin 2023-02-12 14:33:15 0 23K

BigMoney.VIP Powered by Hosting Pokrov