Python Motor vs Pymongo

0
7K

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
Categories
Read More
Mental Health
ADHD: SOCIETY
The youngest children in a class have been found to be more likely to be diagnosed as having...
By Kelsey Rodriguez 2023-04-07 18:27:38 0 7K
Социальные проблемы
Гениальное ограбление. The Vault. (2021)
В ограблении главное правильно подобрать момент. Юный гений Том Джонсон решил проникнуть в сейф...
By Nikolai Pokryshkin 2022-09-13 20:32:31 0 22K
Science Fiction and Fantasy
Star Wars: Episode V - The Empire Strikes Back. (1980)
After the Rebels are brutally overpowered by the Empire on the ice planet Hoth, Luke Skywalker...
By Leonard Pokrovski 2022-11-13 20:22:35 0 18K
History
Platoon. (1986)
Chris Taylor, a neophyte recruit in Vietnam, finds himself caught in a battle of wills between...
By Leonard Pokrovski 2023-04-17 20:46:37 0 20K
Жизненные вопросы
Вечное сияние чистого разума. Eternal Sunshine of the Spotless Mind. (2004)
Застенчивый и меланхоличный Джоэл живёт ничем не примечательной серой и унылой жизнью. Но однажды...
By Nikolai Pokryshkin 2023-01-09 18:38:57 0 25K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov