我正在收集实时推文并存储到一个集合中我现在想从集合中的记录中提取信息:
"place" : { "country_code" : "US", "url" : "http://api.twitter.com/1/geo /id/01fbe706f872cb32.json", "country" : "United States", "place_type" : "city", "bounding_box" : { "type" : "Polygon", "coordinates" : [ [ [ -77.119759, 38.791645 ], [ -76.909393, 38.791645 ], [ -76.909393, 38.995548 ], [ -77.119759, 38.995548 ] ] ] }, "full_name" : "Washington, DC", "attributes" : { }, "id" : "01fbe706f872cb32", "name" : "Washington" }
我只想要坐标信息,所以使用 pymongo 我尝试这样做:
cursor = coll.find({"place.bounding_box.type" : "Polygon"},{"coordinates" : 1}, tailable = True, timeout = False)
但这不会返回边界框是关键的坐标。
我怎样才能得到这些数据返回?
谢谢