1

我已经从 excel 文档中导入了这些数据。

 {
    "_id" : ObjectId("57440d63a458f726a8f95bfe"),
    "state" : "WEST BENGAL",
    "bank" : "STATE BANK OF INDIA",
    "ifsc" : "SBIN0000001",
    "micr code" : "700002021",
    "branch" : "KOLKATA MAIN",
    "address" : "SAMRIDDHI BHAWAN, 1 STRAND ROAD, KOLKATA 700 001",
    "latlong" : "22.569435,88.342932",
    "latitude" : "22.569435",
    "longitude" : "88.342932",
    "city" : "KOLKATA",
    "district" : "KOLKATA",
    "loc" : [
            "88.34",
            "22.57"
        ]
}

这是我的示例文档。我无法在 loc 上创建地理空间索引。如何创作?

4

1 回答 1

0

数组的值需要采用特殊格式才能创建 2D 索引。

地理空间索引

数组的值可以是数组,如 [55.5, 42.3],也可以是嵌入的文档,如 { lng : 55.5 , lat : 42.3 }。

我可以在以下文档上创建二维索引。我认为您需要重新访问 excel 导入过程。

{
    "_id" : ObjectId("57440d63a458f726a8f95bfe"),
    "state" : "WEST BENGAL",
    "bank" : "STATE BANK OF INDIA",
    "ifsc" : "SBIN0000001",
    "micr code" : "700002021",
    "branch" : "KOLKATA MAIN",
    "address" : "SAMRIDDHI BHAWAN, 1 STRAND ROAD, KOLKATA 700 001",
    "latlong" : "22.569435,88.342932",
    "latitude" : "22.569435",
    "longitude" : "88.342932",
    "city" : "KOLKATA",
    "district" : "KOLKATA",
    "loc" : [
            88.34,
            22.57
        ]
}
于 2016-05-24T10:51:03.610 回答