title: PyMongo sort with metadata
body: <p>I wondering how to convert the follow mongodb query to pymongo syntax</p>
  
  <pre><code>db.articles.find(
     { $text: { $search: "cake" } },
     { score: { $meta: "textScore" } }
  ).sort( { score: { $meta: "textScore" } } ).limit(3)
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>results = \
      mongo.db.products.find({ '$text': { '$search': 'cake' } }, { 'score': { '$meta': 'textScore' } }) \
          .sort({ 'score': { '$meta': 'textScore' } }) \
          .limit(3)
  </code></pre>
  
  <p>But I got the follow error on sort:</p>
  
  <pre><code>raise TypeError("second item in each key pair must be 1, -1, "
  TypeError: second item in each key pair must be 1, -1, '2d', 'geoHaystack', or another valid MongoDB index specifier.
  </code></pre>
  
  <p>Anyone can help me?
  Thanks in advance</p>