Python Motor vs Pymongo

0
13كيلو بايت

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.

البحث
الأقسام
إقرأ المزيد
Social Issues
Tenet(2020)
Armed with only one word, Tenet, and fighting for the survival of the entire world, a Protagonist...
بواسطة Leonard Pokrovski 2022-10-16 13:51:00 0 24كيلو بايت
Жизненные вопросы
Развод Надера и Симин. A Separation. (2011)
Супруги Надер и Симин решили уехать из Ирана в поисках лучшей жизни. Но в один момент Надер...
بواسطة Nikolai Pokryshkin 2023-01-27 17:42:01 0 26كيلو بايت
Programming
Mojo Language
Mojo is a Python type language that uses C for the performance. Python is normally slow when it...
بواسطة Jesse Thomas 2023-05-05 20:31:29 0 11كيلو بايت
Научная фантастика и фэнтези
Ходячий замок. Howl's Moving Castle. (2004)
Злая ведьма заточила 18-летнюю Софи в тело старухи. Девушка-бабушка бежит из города куда глаза...
بواسطة Nikolai Pokryshkin 2023-03-07 23:05:07 0 23كيلو بايت
Subcultures
Exploring Society's Subcultures: Unveiling the Tapestry of Diversity
Society is a kaleidoscope of human experiences, where individuals come together, each bringing...
بواسطة Dacey Rankins 2024-06-13 16:22:46 0 17كيلو بايت

BigMoney.VIP Powered by Hosting Pokrov