Python Motor vs Pymongo

0
13Кб

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.

Поиск
Категории
Больше
Finance
The Main Types and Segments of Fintech
The Main Types and Segments of Fintech Introduction Financial technology—better known as...
От Leonard Pokrovski 2025-10-09 17:29:32 0 3Кб
Business
What Metrics Do You Use to Measure Recruiting Success?
Recruiting success isn't just about filling open roles — it's about filling them...
От Dacey Rankins 2025-06-26 16:47:31 0 6Кб
Business
What are Effective Questions to Ask During Customer Development Interviews?
Customer Development interviews are a critical tool for gathering insights directly from your...
От Dacey Rankins 2025-03-25 15:38:17 0 10Кб
Social Issues
Green Book. (2018)
A working-class Italian-American bouncer becomes the driver for an African-American classical...
От Leonard Pokrovski 2023-02-08 12:06:53 0 20Кб
Социальные проблемы
Рай и ад. High and Low. (1963)
Преуспевающий бизнесмен должен решить для себя, заплатит ли он выкуп похитителям, которые по...
От Nikolai Pokryshkin 2023-01-08 22:19:53 0 22Кб

BigMoney.VIP Powered by Hosting Pokrov