title: mongoose: Sorting by id
body: <p>mongo db reorders the documents when ever a document is updated. I dint want this to happen so I found that using order by _id would return the documents in consistent order. But now I am not able to sort. Below is my find query which finds posts created by a particular user and I am trying to sort by _id.
  Code:</p>
  
  <pre><code>app.get('/posts/:user_id',function(req,res){
  
  posts.find({
      'creator.user_id':req.params.user_id
  },[],{ sort: { '_id': -1 } },function(err,userpost){
      if(err)
          res.send(err);
      res.json(userpost);
  
  
  })
  
  });
  </code></pre>