title: InvalidKey in MongoDB and Node.js
body: <p>I have a file which has key as IP <code>"10.11.190.14:cgi6web-1"</code>:    . When I try to insert the file in mongoDB, I get the following error:</p>
  
  <blockquote>
    <p>Error: key 10.11.190.14:cgi6-web-1 must not contain '.'
        at Error (unknown source).</p>
  </blockquote>
  
  <p>I dont have permissions to change the file , is there any work around to write the file to mongoDB with IP as key.</p>
  
  <p>My Code is as follows:</p>
  
  <pre><code>var MongoClient = require('./lib/mongodb').MongoClient;
  var file = require (__dirname + '/functions.json');
  
  MongoClient.connect('mongodb://phx8b03c-fb1d',
      function (err, client) {
          if (err) throw err;
  
          client.createCollection('lbTopology' , function (err, collection) {
              if (err) throw err;
  
              collection.insert(file, 'lbTopology' , function (err) {
                  if (err) throw err;
  
                  client.close(function (err) {
                      if (err) throw err;
  
                      console.log('done');
                  });
              });
          });
      })
  </code></pre>
  
  <p>Can someone please help me with this?</p>