Python Motor vs Pymongo

0
9KB

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.

Search
Nach Verein filtern
Read More
Социальные проблемы
Леон Профессионал. Léon: The Professional. (1994)
Профессиональный убийца Леон неожиданно для себя самого решает помочь 12-летней соседке Матильде,...
Von Nikolai Pokryshkin 2022-11-26 22:44:17 0 25KB
Life Issues
Rear Window. (1954)
A wheelchair-bound photographer spies on his neighbors from his Greenwich Village courtyard...
Von Leonard Pokrovski 2022-12-09 19:36:34 0 24KB
Business
What Is the Company's Management Style?
A company’s management style plays a crucial role in shaping the workplace environment,...
Von Dacey Rankins 2025-06-11 13:44:18 0 811
Almanacs
Almanac
Almanac (fromArabic. ألمناخ—astronomicalcalendar) is a typeof serialpublication, an...
Von FWhoop Xelqua 2022-12-04 17:57:45 0 16KB
Trains and Railroads
Unusual railways of the world
Such a familiar thing for us - the railway! One of the most reliable (safe), affordable...
Von FWhoop Xelqua 2022-11-18 12:58:56 0 20KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov