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.

Search
Categories
Read More
Спорт
Дом на глубине. The Deep House. (2021)
Видеоблогеры Тина и Бен путешествуют по миру, снимая старые заброшенные здания. Решив впечатлить...
By Nikolai Pokryshkin 2022-09-03 20:34:06 0 37K
Radio
Rediscovering Recreation: The Art of Entertainment Through Radio
Rediscovering Recreation: The Art of Entertainment Through Radio In an era of dazzling visual...
By Leonard Pokrovski 2024-05-14 22:18:37 0 19K
Life Issues
The Kid. (1921)
The Tramp cares for an abandoned child, but events put their relationship in jeopardy. My Link
By Leonard Pokrovski 2023-02-04 17:51:54 0 19K
School Time
Nurturing Minds: The Significance of School Time in Children and Teenagers
Nurturing Minds: The Significance of School Time in Children and Teenagers Introduction: School...
By Leonard Pokrovski 2024-05-01 20:27:29 0 19K
Television
RT, live TV. Russia.
RT’s flagship, award-winning English-language channel airs 24/7 from the network’s...
By Nikolai Pokryshkin 2022-11-14 17:11:18 0 32K

BigMoney.VIP Powered by Hosting Pokrov