我有一个扩展的 json 字符串。
{"_id": {"oid": "59a47286cfa9a3a73e51e72c"}, "theaterId": {"numberInt": "101100"}, "location": {"address": {"street1": "340 XDW Market", "city": "Bloomington", "state": "MN", "zipcode": "12427"}, "geo": {"type": "Point", "coordinates": [{"$numberDouble": "-193.24565"}, {"$numberDouble": "144.85466"}]}}}
尝试将上述 json 字符串转换为文档以便将其插入 MongoDB。为此,我使用org.bson.Document.Document.parse(json_string)构造函数。
但是我在解析后得到的文档并没有保留geo.coordinate
arraylist 中的数据类型(检查下面的文档)。虽然它保留theaterId
.
{
"_id": {
"oid": "59a47286cfa9a3a73e51e72c"
},
"theaterId": {
"numberInt": "101100"
},
"location": {
"address": {
"street1": "340 XDW Market",
"city": "Bloomington",
"state": "MN",
"zipcode": "12427"
},
"geo": {
"type": "Point",
"coordinates": [-193.24565, 144.85466]
}
}
}
这是 Document.parse() API 中的潜在问题吗?