How to convert a pymongo.cursor.Cursor into a dict?

前端 未结 6 1431
日久生厌
日久生厌 2020-12-02 16:18

I am using pymongo to query for all items in a region (actually it is to query for all venues in a region on a map). I used db.command(SON()) before to search i

6条回答
  •  [愿得一人]
    2020-12-02 17:01

    to_dict() Convert a SON document to a normal Python dictionary instance.

    This is trickier than just dict(...) because it needs to be recursive.

    http://api.mongodb.org/python/current/api/bson/son.html

提交回复
热议问题