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
Социальные проблемы
Однажды в Америке. Once Upon a Time in America. (1984)
В бурные двадцатые годы, когда Америка веселилась под звуки джаза, и каждый бродяга мечтал стать...
Par Nikolai Pokryshkin 2023-01-04 15:21:05 0 30KB
Productivity
How do you balance short-term tasks with long-term goals?
Balancing short-term tasks with long-term goals is one of the most critical—and often...
Par Michael Pokrovski 2026-03-23 22:38:26 0 8KB
Business
How to Migrate to IaaS?
Most infrastructure migrations do not fail because of technology. They fail because of...
Par Dacey Rankins 2026-06-08 16:23:52 0 1KB
Libraries
Exploring Some of the Most Popular Libraries Around the World
Libraries have long been centers of knowledge, learning, and culture, but some libraries stand...
Par Dacey Rankins 2024-12-12 14:16:11 0 11KB
Business
Drew Houston
Drew Houston Drew Houston Andrew W. "Drew" Houston   Date of...
Par Leonard Pokrovski 2024-08-16 14:54:55 0 27KB

BigMoney.VIP Powered by Hosting Pokrov