My collection
{"_id" : ObjectId("58240d6eb3fe299a1f28bdf0"),
"id" : NumberLong(52),
"user_id" : NumberLong(2),
"user_type" : "user",
"type_id" : "399278",
"type" : "poi",
"type_name" : "Kala Ghoda Amphitheatre",
"attending" : NumberLong(0),
"domain" : "",
"track_time" : "0000-00-00 00:00:00",
"latitude" : "18.92728500",
"longitude" : "72.83274200",
"fb_postid" : "",
"event_date" : "0000-00-00",
"m_event_date" : NumberLong("-62169984000"),
"m_type_id" : "poi__399278",
"loc" : {
"type" : "Point",
"coordinates" : [
18.927285,
72.832742
]
}
创建索引 db.user_tracking。ensureIndex({" location "; 2sphere "})
我有这个错误:
"ok" : 0,
"errmsg" : "Can't extract geo keys: { _id: ObjectId('58240d6eb3fe299a1f28bdf1'), id: 84, user_id: 2, user_type: '"wcities'", type_id: '"23621'", type: '"poi'", type_name: '"Alcatraz Island'", attending: 1, domain: '"Parrot'", track_time: '"2015-02-02 06:33:34'", latitude: '"37.82668800'", longitude: '"-122.42302500'", fb_postid: '"'", event_date: '"0000-00-00'", m_event_date: -62169984000, m_type_id: '"poi__23621'", loc: { type: '"Point'", coordinates: [ 37.826688, -122.423025 ] } } longitude/latitude is out of bounds, lng: 37.8267 lat: -122.423",
"code" : 16755
}
错误显示全部为longitude/latitude is out of bounds
查看允许的范围的答案。你的lng: 37.8267 lat: -122.423
的纬度超出了+90/-90的范围。你需要改正有这些数据的那份文件。
更多关于geoJSON的信息