Python Motor vs Pymongo

0
7KB

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
Programming
JavaScript vs TypeScript
Difference between TypeScript and JavaScript JavaScript and TypeScript look very similar, but...
Por Jesse Thomas 2023-05-26 21:10:06 0 6KB
Programming
Python Module
If you quit from the Python interpreter and enter it again, the definitions you have made...
Por Jesse Thomas 2023-04-05 00:07:17 0 6KB
Television
The Evolution of Television: A Cultural Revolution in Pictures and Sound
Television has become one of the most influential inventions in modern history, shaping not only...
Por Dacey Rankins 2024-11-05 15:40:04 0 4KB
Products and Shopping
10 health products that will not hit the wallet
Hello, dear readers! Today we will talk about useful products for health. As you...
Por FWhoop Xelqua 2022-09-15 18:09:33 0 44KB
Programming
Python Newline
In Python, the new line character “\n” is used to create a new line....
Por Jesse Thomas 2023-03-01 22:08:02 0 6KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov