Python Motor vs Pymongo

0
14K

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.

Pesquisar
Categorias
Leia Mais
Научная фантастика и фэнтези
Парк Юрского периода - Антология. Jurassic Park - Anthology. (1993-2022) Все фильмы.
Парк юрского периода. (1993)Глава компании «Ин-Ген», профессор Джон Хаммонд, находит...
Por Nikolai Pokryshkin 2023-02-17 12:46:05 0 32K
Business
Cybernetics
Cybernetics Cybernetics (from Ancient...
Por Leonard Pokrovski 2024-08-21 01:08:17 0 23K
Business
Product Career Strategy: How to Become a CPO Through Professional Brand Development
Product Career Strategy: How to Become a CPO Through Professional Brand Development...
Por Leonard Pokrovski 2024-08-27 16:05:41 0 30K
Brokerage and Mortgaging
Understanding Brokerage and Mortgaging: Key Concepts for Homebuyers and Investors
The world of real estate is multifaceted and often confusing for those who are new to it. Two...
Por Dacey Rankins 2024-11-26 14:39:25 0 12K
Economics
Why do some countries prosper?
Why Do Some Countries Prosper? The contrast is startling. Stand on a street corner in Zurich...
Por Leonard Pokrovski 2026-06-21 07:49:03 0 775

BigMoney.VIP Powered by Hosting Pokrov