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
Segurança
Understanding Computer Security: Safeguarding the Digital Age
In today’s interconnected world, where nearly every aspect of our lives is touched by...
Por Dacey Rankins 2024-11-15 14:56:17 0 14K
Искусство, культура и развлечения
Круиз по джунглям. Jungle Cruise. (2021)
Хитростью и немалой сноровкой раздобыв бесценную карту верховьев Амазонки, бойкая археолог Лили...
Por Nikolai Pokryshkin 2022-09-03 21:05:25 1 32K
Men's Health
Men's Health: Key Aspects and Tips for a Longer, Healthier Life
Men's health is a crucial aspect of overall well-being, encompassing physical, mental, and...
Por Dacey Rankins 2024-11-21 15:52:31 0 12K
Intranet
What is an intranet?
An intranet (from the Latin intra – internal – and English net – network) is a...
Por Dacey Rankins 2024-03-26 17:03:22 0 25K
Human Resources
How Do Companies Choose Outsourcing Partners?
Choosing the right outsourcing partner is one of the most critical decisions a company can make...
Por Dacey Rankins 2026-04-04 19:05:32 0 2K

BigMoney.VIP Powered by Hosting Pokrov