Python Motor vs Pymongo

0
13KB

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.

Suche
Kategorien
Mehr lesen
Business
What is Customer Development?
Customer Development is a methodology for creating products or businesses by testing ideas or...
Von Dacey Rankins 2025-03-25 15:34:42 0 9KB
Спорт
Сестры на старте. Sisters on Track. (2021)
Документальный фильм Netflix "Sisters On Track" - это дико аутентичная история взросления трех...
Von Nikolai Pokryshkin 2022-09-03 20:46:51 0 36KB
Business and Corporate Finance
How Do I Manage Cash Flow in a Small Business?
How Do I Manage Cash Flow in a Small Business?Budgeting and Forecasting Explained Managing cash...
Von Leonard Pokrovski 2026-01-06 07:23:47 0 1KB
История
Куда ты идешь, Аида? Quo vadis, Aida? (2020)
Аида — переводчица при нидерландском контингенте войск ООН. В Сребренице живут её муж и...
Von Nikolai Pokryshkin 2022-09-11 21:38:16 0 32KB
Искусство, культура и развлечения
Мадам Парфюмер. Perfumes. (2020)
Анна Вальберг — знаменитость в мире парфюмерии. Она живет как дива, ведет себя как эгоистка...
Von Nikolai Pokryshkin 2022-09-30 21:26:20 0 26KB

BigMoney.VIP Powered by Hosting Pokrov