我在嘗試讓mongo正確返回幾何數據時遇到了一些麻煩。Mongo findOne節點的函數不返回geomertrty數據
當我在蒙戈shell中運行db.shapes_houses.findOne({ 'properties.IDENTIFCAT': '0373100000004063' }
功能直接我得到正確的結果我需要:
{
"_id" : ObjectId("576bfc6d669adc5c2556676b"),
"type" : "Feature",
"properties" : {
"IDENTIFCAT" : "0373100000004063",
"VOETPRINT" : 62.423811
},
"geometry" : {
"type" : "Polygon",
"coordinates" : [
[
[
105719.1640625,
515371.03125
],
[
105715.9921875,
515375.4375
],
[
105722.84375,
515380.375
],
[
105725.3359375,
515382.15625
],
[
105728.5,
515377.75
],
[
105726.015625,
515375.96875
],
[
105719.1640625,
515371.03125
]
]
]
}
}
然而,當我通過節點的應用程序運行db.Object.findOne({ 'properties.IDENTIFCAT': '0373100000004063' }).exec()
我不明白任何幾何數據,只有id,類型和屬性被返回。
有沒有人知道爲什麼會發生這種情況?我正在把頭髮撕掉。
謝謝!
你在使用貓鼬嗎?如果是這樣,你能顯示模式嗎? – robertklep
不使用貓鼬依賴 - 只是蒙哥... – bloomy
你能指定_「我沒有得到任何幾何數據」_? 'geometry'屬性是否丟失?它是空的嗎?你是否聲稱文檔的'_id'與Mongo shell中顯示的相同? – robertklep