pymongo更新字典列表中的值

时间:2019-04-20 14:03:16

标签: pymongo

我在MongoDB集合中具有以下结构。集合正在存储出租车预订信息出租车是否正在运行

{
    "_id" : ObjectId("5cbb2205fd96f222ba29024a"),
    "users_data" : [
        {
            "status" : "Not yet started",
            "distance" : "10",
            "route" : [
                "pune station",
                "shivaji nagar",
                "pune university"
            ],
            "route_details" : [
                [
                    "pune station",
                    "shivaji nagar",
                    5
                ],
                [
                    "shivaji nagar",
                    "pune university",
                    5
                ]
            ],
            "user_session_id" : "5cbab001fd96f21c9b8af9bc"
        }
    ]
}

如何使用python更新users_data status

0 个答案:

没有答案