【发布时间】:2022-01-19 08:38:38
【问题描述】:
这是我在 MongoDB 数据源中的 JSON 输入。
{
"_id" : ObjectId("61b84ae8e831076431a67f9e"),
"nameId" : "A123R3",
"__v" : NumberInt(0),
"createdAt" : ISODate("2021-12-14T07:42:31.764+0000"),
"data" : [
{
"sources" : [],
"_id" : ObjectId("61b84ae7abea48f85c97e37e"),
"inputImage" : "URL1",
"outputImage" : "URL2",
"timeTracks" : {
"main" : {
"total" : 2.993,
"actualTotal" : 2.993
}
},
"source" : "ui"
},
{
"sources" : [],
"_id" : ObjectId("61b84ae8c7dc60f88356bf97"),
"inputImage" : "URL3",
"outputImage" : "URL4",
"timeTracks" : {
"main" : {
"total" : 3.283,
"actualTotal" : 3.28
}
},
"source" : "ui"
},
],
"updatedAt" : ISODate("2021-12-14T07:42:32.082+0000")
}
【问题讨论】:
-
能否将您的 json 记录转换为 python dict,否则我们无法转换
ObjectId和ISODate。 -
@Corralien 不知道将我的 JSON 转换为 python 字典。忽略那个 Objectid。
标签: python pandas dataframe pymongo