title: How do I deal with dots in MongoDB key names?
body: <p>I'm developing this piece of software in Node and MongoDB in which I essentially want to store versions of packages with the following structure:</p>
  
  <pre><code>{
      "versions":
      {
          "1.2.3": { stuff }
      }
  }
  </code></pre>
  
  <p>(similar to how npm does things in couch)</p>
  
  <p>The issue is that when I updated MongoDB I discovered that it doesn't allow dots in key names (due to dot notation existing), causing my code to fail. After researching this, all I could find is that you need to transform the dots to some other character before storing in the db, then transform them back again when accessing. Is there really no better way to deal with this?</p>
  
  <p>If there isn't, how can I do this transformation without copying the data over to another key and deleting the original?</p>