title: MongoDB not allowing using '.' in key
body: <p>I'm trying to save a dictionary containing a special character '.' in key portion to the MongoDB. The error is presented below, which clearly states that the key must not contain a special character '.'.</p>
  
  <pre><code>&gt;&gt;&gt; import pymongo
  &gt;&gt;&gt; client = pymongo.MongoClient('localhost')
  &gt;&gt;&gt; db = client['malware']                                                                                                                                                          
  &gt;&gt;&gt; test = db['test']
  &gt;&gt;&gt; d = {'.aaa' : '.bbb'}                                                                                                                                                           
  &gt;&gt;&gt; test.insert(d)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib64/python2.7/site-packages/pymongo/collection.py", line 362, in insert
      self.database.connection)
  bson.errors.InvalidDocument: key '.aaa' must not contain '.'
  </code></pre>
  
  <p>But my current information contains '.' in the key portion of the data, which I need to store to MongoDB. Currently I was just deleting the '.' from the string, another options would be to replace it with '_' or some other special character. </p>
  
  <p>Nevertheless, all results in loss of information, because if I have a key '.aaa' and a key '<em>aaa' and if I convert '.' into '</em>' then the keys are exactly the same and I lose some information. Why isn't Mongo allowing me to save the '.aaa' into the DB? </p>
  
  <p>Any ideas how to approach the problem?</p>