Python Motor vs Pymongo

0
14KB

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.

Rechercher
Catégories
Lire la suite
Agriculture
Agricultural Sciences
Agricultural sciences are a broad, interdisciplinary field that encompasses parts of the exact,...
Par FWhoop Xelqua 2023-04-18 18:07:48 0 19KB
Social Issues
Toy Story. (1995)
A cowboy doll is profoundly threatened and jealous when a new spaceman action figure supplants...
Par Leonard Pokrovski 2023-01-01 20:51:01 0 26KB
Decision Making and Problem Solving
How does dehydration affect memory?
The mind is not a warehouse, and it is certainly not a hard drive. We operate under the...
Par Michael Pokrovski 2026-07-12 21:57:30 0 787
Mental Health
How to make the brain work 100 percent at any age
For a long time, there was a hypothesis that, getting involved in any work, we use only 10% of...
Par FWhoop Xelqua 2023-06-23 15:34:54 0 30KB
Television
BRIC TV. Live TV.
Brooklyn Community Access Television (BCAT TV Network) is the Public, educational, and government...
Par Nikolai Pokryshkin 2022-10-13 10:47:10 0 45KB

BigMoney.VIP Powered by Hosting Pokrov