I am using mongodb in python. The problem I'm facing is during the generation of a key. The code through which I'm generating a key is:
post_id = posts.insert_one({msg["To"]:a}
Now here, the "To" consist of an email address (which consists of a symbol dot(.)). I researched few documents online and I got to knew that “To” of a mail cannot be used as a key, because in mongodb they use “.(dot)” and “$” as a nested document.
So now how can I proceed?