title: Validate with an specific field of a mongodb query
body: <p>I'm using mongoose and I have a car schema in Mongodb and each car has a schema for <code>typeOfCar</code>. I need to find out the <code>typeOfCar</code> value of and specific car and store it for use it later in a validation if. </p>
  
  <p>All the queries and the connection with the DB work fine but I can't make my purpose.</p>
  
  <p>Here is a chunk of my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var typeOfCar;
  Cars.findOne({carName : carName},{"typeOfCar":1, _id:0}, function(car){
    typeOfCar = car;
  });
  if(typeOfCar = "Sedan"){
    //something happen
  }else{
    //something happen
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks and sorry my bad English :(</p>