【发布时间】:2020-06-07 20:39:58
【问题描述】:
我在 MongoDB 中存储了以下文档:
{
"_id": 2,
"template_name": "AllahabadBank",
"description": "Form For NewCustomer Application In Banking System",
"handwritten": "true",
"file_path": "./serverData/batchProcessedFiles/AllahabadBank/input",
"annotated_data": [{
"page_num": "page-01.jpg",
"entities": [{
"label": "CIFNo",
"type": "text",
"boundary_box": {
"x1": 325,
"x2": 861,
"y1": 324,
"y2": 360
}
}],
"num_of_pages": 12
}]
}
并且想将下面的 JSON 数据插入到 annotated_data。建议我使用 MongoDB 查询或 Python 代码来执行此操作。
{
"page_num": "page-02.jpg",
"entities": [
{
"label": "CustomerName",
"type": "text",
"boundary_box": {
"x1": 559,
"x2": 1615,
"y1": 382,
"y2": 440
}
}
]
}
【问题讨论】:
-
您的示例文档无效。请提供一个有效的。
标签: python-3.x mongodb nosql pymongo