Python Motor vs Pymongo

0
7KB

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
Science Fiction and Fantasy
Logan. (2017)
In a future where mutants are nearly extinct, an elderly and weary Logan leads a quiet life. But...
Von Leonard Pokrovski 2023-04-20 20:33:24 0 16KB
Television
Revelation Live TV. United Kingdom.
Our Mission is to use Media to strengthen the Christian voice and impact the nations, with the...
Von Nikolai Pokryshkin 2022-11-28 18:16:17 0 24KB
Health
Children's Health Trends: Insights Backed by Research and Statistics
In recent years, research and statistical analysis have provided invaluable insights into the...
Von Dacey Rankins 2024-04-30 18:30:08 0 11KB
История
Касабланка. Casablanca. (1942)
Оставивший родину американец Рик Блэйн, владелец игорного клуба в Касабланке, встречается с...
Von Nikolai Pokryshkin 2022-12-04 12:29:50 0 18KB
Medicine
Medication
Medication Lekárstvennyj...
Von Leonard Pokrovski 2024-04-16 19:27:09 0 9KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov