Key must not contain . error in pymongo

前端 未结 3 660
Happy的楠姐
Happy的楠姐 2021-01-19 06:33

I am trying to get the output of serverStatus command via pymongo and then insert it into a mongodb collection. Here is the dictionary

{u\'metrics\': {u\'getLa

3条回答
  •  旧时难觅i
    2021-01-19 06:39

    A solution that worked for me was to wrap the dictionary inside a python list:

    new_item_to_store = list(dict_to_store.items())
    

提交回复
热议问题