title: MongoDB: Sort by field existing and then alphabetically
body: <p>In my database I have a field of <code>name</code>. In some records it is an empty string, in others it has a name in it.</p>
  
  <p>In my query, I'm currently doing:</p>
  
  <pre><code>db.users.find({}).sort({'name': 1})
  </code></pre>
  
  <p>However, this returns results with an empty name field first, then alphabetically returns results. As expected, doing <code>.sort({'name': -1})</code> returns results with a name and then results with an empty string, but it's in reverse-alphabetical order.</p>
  
  <p>Is there an elegant way to achieve this type of sorting?</p>