title: mongodb Dog.find() is executing before Dog.create()
body: <p><strong>mongodb Dog.find() is executing before Dog.create()</strong> </p>
  
  <p>i just have a some problem that i can't understand as so why its happening.
  I just started learning mongodb with online tutorial.I practice my code at cloud9.
  I was practicing the basic queries such as find() and create().
  i added the Dog.create() method first by adding a new dog with just a name parameter and the subsequently below the create() method i added Dog.find() to find all the data present in the db.</p>
  
  <p>But the problem is Dog.find() executes first and the Dog.create executes at last.</p>
  
  <p>I have posted the code below.</p>
  
  <pre><code>var mongoose= require("mongoose");
  mongoose.connect("mongodb://localhost/dog_app");
  
  var dogSchema = new mongoose.Schema({
    name:String
  });
  
  var Dog = mongoose.model("Dog", dogSchema);
  
  Dog.create({
      name:"duppy"
  }, function(err, dog){
      if(err){
          console.log(err);
      }else{
          console.log("created a new dog");
          console.log(dog);
      }
  });
  
  Dog.find({}, function(err , dogs){
     if(err){
         console.log(err);
     } else{
         console.log("retrived from database");
         console.log(dogs);
     }
  });
  </code></pre>
  
  <p><strong>Results</strong> </p>
  
  <pre><code>adi188288:~/workspace/IntroToNode/Databases $ node dogs.js
  (node:7113) DeprecationWarning: `open()` is deprecated in mongoose &gt;= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
  retrived from database
  [ { _id: 59bd6256bffba3198bce7e87, name: 'Puppy', __v: 0 } ]
  created a new dog
  { __v: 0, name: 'Puppy2', _id: 59bd6932a2d4c81bc9488b74 }
  </code></pre>
  
  <p>You can see the results that first the find method is executing and then a create method occurs.Can Anyone Explain this to me?</p>