0
我有以下收集文件過濾掉從收集文檔字段並將其存儲在新的集合
{
"Dine" : {
"Cuisine" : "North Indian",
"Popular Dishes" : "Aaloo Tikki, Pao Bhaji, Bhalla Papdi",
"Dine In Available" : "Yes",
"Online Booking" : "",
"Home Delivery" : "",
"Pure Veg" : "Yes",
"Restaurant Type" : "",
"Air Conditioned" : "",
"Outdoor Area" : "",
"Pint of Beer" : "",
"Bar Available" : "",
"Wifi" : "",
"Number of Deals" : "",
"Happy Hours" : "",
"Cost for 2" : "Rs 0-250",
"Credit Cards Accepted" : "",
"Deal Available" : ""
},
"Location Details" : {
"Latitude" : "28.7004740",
"Longitude" : "77.1174010",
},
"MetaData" : {
"Meta Description" : "",
"Meta Keywords" : ""
},
"Operation Hours" : {
"Operation Hours" : "11 AM-11 PM"
},
"Other Options" : {
"Chain Name" : "",
"Expiry Date" : "",
"As seen in" : "",
"Deals Head" : "",
"Deals ID" : "",
"Events Head" : "",
"Events ID" : "",
"Show Bookings" : "",
"Form Reciever Email" : "",
"Powered By" : "",
"Show Photos" : ""
},
"__v" : 0,
"_id" : "-bittoo"
}
我想打一個文件,如:
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
}
}
其中類型:Feature
和geometry.type:Point
是默認編寫的。座標是緯度和經度從「位置詳細信息」,進一步我想存儲這些生成的r將其存儲在另一個集合中。
嗨Aditya - 你能解釋一下你想使用什麼樣的轉換,將這些經緯度數字轉換爲這些座標數字嗎? –
試試這個帖子中的答案http://stackoverflow.com/questions/9711529/save-subset-of-mongodb-collection-to-another-collection –