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.

Site içinde arama yapın
Kategoriler
Read More
Природа и наука
Принцесса Мононоке. Princess Mononoke. (1997)
Убив вепря, юный принц Аситака навлек на себя смертельное проклятие. Старая знахарка предсказала,...
By Nikolai Pokryshkin 2023-01-03 22:51:08 0 27K
Business
About brand positioning and building
Positioning is important. Very important. Positioning is necessary in order to...
By Dacey Rankins 2024-09-06 20:32:42 0 17K
Business
What Are the CEO's Major Accomplishments?
A CEO’s major accomplishments serve as powerful indicators of their leadership capability,...
By Dacey Rankins 2025-06-30 14:10:46 0 6K
Internet
Windows OS will be transferred to the "cloud"
Microsoft has planned to completely transfer the Windows operating system (OS) to the "cloud"...
By FWhoop Xelqua 2023-06-28 18:03:35 0 23K
Business
How Can One Start a Social Enterprise?
Starting a social enterprise is an exciting and impactful way to address critical social or...
By Dacey Rankins 2025-04-16 17:11:35 0 9K

BigMoney.VIP Powered by Hosting Pokrov