【发布时间】:2021-11-12 19:19:42
【问题描述】:
我正在尝试将从“最近”查询返回的这个 MongoDB Cursor() 对象转换为列表数据类型。这似乎是我的代码中的瓶颈。我希望这个操作能在几毫秒内完成。任何帮助将不胜感激。谢谢。
nearest = self.database_objs[common_models.ObjModel().current_geographic_collection].find({"location": {
"$geoWithin": {
"$centerSphere": [start, self.distance_radians(self.feet_meter(radius))]}}})
print(list(nearest)) # problem here
【问题讨论】:
标签: python mongodb list cursor pymongo