title: NodeJS + MongoDB: Getting data from collection with findOne ()
body: <p>I have a collection "companies" with several objects. Every object has "_id" parameter. I'm trying to get this parameter from db:</p>
  
  <pre><code>app.get('/companies/:id',function(req,res){
  db.collection("companies",function(err,collection){
      console.log(req.params.id);
      collection.findOne({_id: req.params.id},function(err, doc) {
          if (doc){
              console.log(doc._id);
          } else {
              console.log('no data for this company');
          }
      });
  });
  });
  </code></pre>
  
  <p>So, I request companies/4fcfd7f246e1464d05000001 (4fcfd7f246e1464d05000001 is _id-parma of a object I need) and findOne returns nothing, that' why console.log('no data for this company'); executes.</p>
  
  <p>I'm absolutely sure that I have an object with _id="4fcfd7f246e1464d05000001". What I'm doing wrong? Thanks!</p>
  
  <p><strong>However, I've just noticed that id is not a typical string field. That's what mViewer shows:</strong></p>
  
  <pre><code>"_id": {
          "$oid": "4fcfd7f246e1464d05000001"
      },
  </code></pre>
  
  <p>Seems to be strange a bit...</p>