如何从atat中将mongodb集合导出到JSON中的本地内存中
我正在使用
mongoexport -d -c --jsonArray -o nametosave
(或)
mongoexport -d -c --out name.json
在两种情况下,我都得到JSON之类的信息:
{"_id":{"$oid":"xxxxxxxxxxx"}
,“ geo”:[“ 13.0156289”,“ 77.6321339”],“ locality”:“ Kacharakanahalli”,“ pincode”:560084,“ state”:“ Karnataka”,“ created_at”:{ “ $ date”:“ 2018-08-10T08:19:17.086Z”},“ updated_at”:{“ $ date”:“ 2018-08-10T08:19:17.086Z”},“ __ v”:0}
{“ _id”:{“ $ oid”:“ xxxxxxxxx”},“ geo”:[“ 13.0280047”,“ 77.6399711”],“ locality”:“ Kalyanagar”,“ pincode”:560043,“ state”:“ Karnataka “,” created_at“:{” $ date“:” 2018-08-10T08:19:17.086Z“},” updated_at“:{” $ date“:” 2018-08-10T08:19:17.086Z“}, “ __v”:0}
我需要获取不带$ oid和$ date的JSON,我需要直接像这样
{"_id":"xxxxxxxxxxx"}
为了满足此要求,我在导出集合时需要使用什么过程