How to get the length of a cursor from mongodb using python?

后端 未结 6 1458
南笙
南笙 2021-02-19 01:49

I\'m looking for a feasible way to get the length of cursor got from MongoDB.

6条回答
  •  迷失自我
    2021-02-19 02:30

    The cursor.count method is deprecated since pymongo 3.7.

    The recommended method is to use the count_documents method of the collection.

提交回复
热议问题