title: MongoDb/php Get max id value on a collection
body: <p>I want to get the max id value on a collection.</p>
  
  <p>How do I convert the mongoDb query:</p>
  
  <pre><code>db.tweets.find({},{id:1}).sort({id:-1}).limit(1)
  </code></pre>
  
  <p>to Mongo Query Language Statement using PHP?</p>
  
  <p>I'm trying</p>
  
  <pre><code>$db-&gt;tweets-&gt;find(
      array(),
      array("id"=&gt;1)
  )-&gt;sort(array("id"=&gt; -1))-&gt;limit(1);
  </code></pre>
  
  <p>but that doesn't work.</p>