title: NodeJS + Node-MongoDB-native: sort objects in alphabet order
body: <p>I'm trying to sort objects in collection by "name" parameter in alphabetical order. Here's the code I'm using:</p>
  
  <pre><code>app.get('/companies', loadUser, function(req,res){
      db.collection("companies",function(err,collection){
              collection.find({}, { sort:[['name',-1]]},function(err, companies) {
                  var companies_list = new Array();
                  companies.each(function(err, company){
              ... 
              });
      })
  });
  </code></pre>
  
  <p>I actually don't understand how exactly sort parameter works and what is -1. The <a href="https://github.com/christkv/node-mongodb-native/blob/master/docs/queries.md" rel="nofollow">official documentation</a> didn't help me. Thanks!</p>