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
Природа и наука
Том и Джерри. Tom & Jerry. (2021)
Кайла, сотрудница престижного отеля, где обитает мышонок Джерри, рискующий нарушить ход дорогой...
By Nikolai Pokryshkin 2022-09-17 20:24:11 0 28K
Business
How Can a Startup CEO Effectively Scale the Company?
Scaling a startup is one of the most challenging—and rewarding—phases in a...
By Dacey Rankins 2025-05-06 12:53:02 0 12K
Социальные проблемы
Довод. Tenet. (2020)
После теракта в киевском оперном театре агент ЦРУ объединяется с британской разведкой, чтобы...
By Nikolai Pokryshkin 2022-10-15 22:43:39 0 32K
Programming
Python Regex
A RegEx, or Regular Expression, is a sequence of characters that forms a search...
By Jesse Thomas 2023-04-05 19:02:13 0 11K
Marketing and Advertising
What is Copywriting?
The Complete Guide to Persuasive Writing for Marketing and Business Success Copywriting is one...
By Dacey Rankins 2025-09-30 15:58:04 0 3K

BigMoney.VIP Powered by Hosting Pokrov