I get the below error as there are numerical values in my dictionary keys.
Hi Kelum,
You are receiving the error message because MongoDB field names should be in strings. Depending on your use case, you can just use string keys:
testDictionary = {'EYData': [{ "1": 100, "test1": "test"}, { "test":100, "test1": "test"}]}
If these keys are from a variable, then you can try to cast them using str(). i.e. str(variable).
Regards,
Wan.