title: Multiple criteria possible in one query inside MongoDB?
body: <p>I've a "words" collection in MongoDB. When I want to search the collection I want to list first words that starts with the "word" and then contains the "word" that I querid. In the same array I get this result; "simarte", "Cumartesti", "Mart", "marti", "martilar". When I search with contains it brings me other words that contains the "word" (mart). </p>
  
  <p>I want to order first the words that starts with the "word" than order "contains" the words. Is it possible to do that in one query? I don't want to make a second request to db. </p>
  
  <p>Here is my code sample:</p>
  
  <pre><code>    var word = "mart";
      db.words.find({"w" : {$regex : ".*" + word + ".*"}}, function(err, words) {
        if( err || !words) console.log("No data found");
        else{
         res.render('index', { title: 'Words', word_data: words, word : word });
       }
      });
  </code></pre>