title: How to extract last objectID of mongoDB document in Python?
body: <p>I want to extract last objectID of a document from a collection in python and want to store it in python object.</p>
  <p>I am doing something like this</p>
  <pre><code>db.dataset2.find().sort( {'_id': -1 } ).limit(1);
  </code></pre>
  <p>But it gives me an error.</p>
  <pre><code>TypeError: if no direction is specified, key_or_list must be an instance of the list
  </code></pre>
  <p>Please help.</p>