-1
나는 다음과 같은 JSON 구조가 있습니다중첩 된 필드의 Geoindex?
{
"type": "Feature",
"id": "node/1717565071",
"properties": {
"type": "node",
"id": 1717565071,
"tags": {
"amenity": "post_box",
"operator": "P&T",
"collection_times": "Mo-Fr 08:30, Sa 08:00"
},
"relations": [],
"meta": {
"timestamp": "2012-04-15T09:24:35Z",
"version": 1,
"changeset": 11307674,
"user": "kewl",
"uid": 317259
}
},
"geometry": {
"type": "Point",
"coordinates": [
6.1428674,
49.5716325
]
}
}
나는 그것을 위해 geoindex의 생성을 실행해야합니다. 간단한 출력을
127.0.0.1:[email protected]> db.lux1.ensureIndex({ type: "geo", fields: [ "coordinates" ] })
{
"id" : "lux1/569778",
"type" : "geo1",
"fields" : [
"coordinates"
],
"geoJson" : false,
"constraint" : false,
"unique" : false,
"ignoreNull" : true,
"sparse" : true,
"isNewlyCreated" : false,
"code" : 200
}
내가 어떤 처리를 기대하지만,하지 :
나는 명령을 실행합니다.
는 또한 시도 : 이127.0.0.1:[email protected]> db.lux1.ensureIndex({ type: "geo", fields: [ "geometry.coordinates" ] })
{
"id" : "lux1/570071",
"type" : "geo1",
"fields" : [
"geometry.coordinates"
],
"geoJson" : false,
"constraint" : false,
"unique" : false,
"ignoreNull" : true,
"sparse" : true,
"isNewlyCreated" : true,
"code" : 201
}
내가 fields
부재중이라고 생각합니다.
생성 색인에 올바른 키를 어떻게 지정할 수 있습니까?