pymongo: MongoClient or Connection

后端 未结 3 1240
误落风尘
误落风尘 2020-12-17 19:32

I am trying to connect mongodb using pymongo. I see two classes to connect to mongodb.

MongoClient and Connection. 

What is the difference

3条回答
  •  独厮守ぢ
    2020-12-17 20:07

    Connection has been deprecated. All of the official MongoDB drivers have a new behavior using safe mode on true (No fire-and-forget).

    MongoClient must be used instead of Connection.

    UPDATE: All new features and changes will be made on MongoClient, not on Connection.

提交回复
热议问题