我有一个包含250行的数据集,如下所示:
在MongoDB Compass中,我插入了第一行,如下所示:
db.employees.insertOne([{"employee_id": 412153,
"first_name": "Carrol",
"last_name": "Dhin",
"email": "carrol.dhin@company.com",
"managing": [{"manager_id": 412153, "employee_id": 174543}],
"department": [{"department_name": "Accounting", "department_budget": 500000}],
"laptop": [{"serial_number": "CSS49745",
"manufacturer": "Lenovo",
"model": "X1 Gen 10",
"date_assigned": {$date: 01-15-2022},
"installed_software": ["MS Office", "Adobe Acrobat", "Slack"]}]})
如果我想在Python中使用PyMongo将所有250行插入到数据库中,我如何确保每一行都遵循我在Mongo shell中手动插入时使用的格式?
1条答案
按热度按时间wqsoz72f1#