title: A possible timeout in find() method - mongoDb
body: <p>I'm writing a Node.js project using MongoDb and socket.io. I met one problem. I have a collection called rooms <code>rooms = db.collection('rooms');</code>
  Here's my code when i'm trying to join a room </p>
  
  <pre><code>rooms.find({name: roomName}).limit(1).toArray()
     .then(function (res) { //if successful
         res = res[0]; //i get my username
  </code></pre>
  
  <p>If there's a room with the given <code>id</code> I connect to it, otherwise it must be created.</p>
  
  <p>But when i create a new room i get <code>undefined</code>, but when I connect the second time (the room already exists) it's all ok, i get all the information. So when I create a room and connect to it, I don't get my username, but when it's created (I'm connecting to it the second time) it displays me the method. </p>
  
  <p><code>var mongo = require('mongodb').MongoClient</code> - module,</p>
  
  <pre><code>function http(io) { mongo.connect(config.mongodb_url) 
    .then(function (db) { ... 
  </code></pre>
  
  <p>-connection,</p>
  
  <p><code>"mongodb version": "^2.1.7"</code></p>
  
  <p>This is how i create a room </p>
  
  <pre><code>rooms.findOneAndUpdate(
    {name: roomName},
    {$addToSet: {users: uuid}}
  ).then(users_update).catch(logger.error);
  </code></pre>
  
  <p>}).catch(logger.error);</p>
  
  <p>I'm wondering if there are some timeout in the find method? Or where can be here the mistake?</p>