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
Financial Services
Elasticity and tax revenue
Key points Tax incidence is the manner in which the tax burden is divided...
By Mark Lorenzo 2023-07-06 20:21:10 0 9K
История
Взвод. Platoon. (1986)
В сентябре 1967 года куда-то в приграничный район между Вьетнамом и Камбоджей прибыл рядовой...
By Nikolai Pokryshkin 2023-04-16 17:55:42 0 22K
Financial Services
How changes in the cost of living are measured
Key points The Consumer Price Index, or CPI is a measure of...
By Mark Lorenzo 2023-06-09 20:21:34 0 8K
Жизненные вопросы
Три билборда на границе Эббинга, Миссури. Three Billboards Outside Ebbing, Missouri. (2017)
Спустя несколько месяцев после убийства дочери Милдред Хейс преступники так и не найдены....
By Nikolai Pokryshkin 2023-03-07 23:38:28 0 18K
Gay, Lesbian, and Bisexual
LGBTQIA+
LGBT is an acronym for lesbian, gay, bisexual, and transgender people. It appeared in English in...
By FWhoop Xelqua 2023-03-22 13:29:38 0 14K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov