title: Get last document in MongoDB collection
body: <p>I am trying to get the last document in a MongoDB collection.
  The following works in the Mongo shell:</p>
  <pre><code>db.collection.find().limit(1).sort({$natural:-1}) 
  </code></pre>
  <p>Results in the last object like so:</p>
  <pre><code>{ &quot;_id&quot; : ObjectId(&quot;62c8817075c9400469b1fc3a&quot;), &quot;token&quot; : &quot;135e53ebb05aa2b6055513843cb8e0dca1&quot;, &quot;createdAt&quot; : ISODate(&quot;2022-07-08T19:11:44.730Z&quot;), &quot;updatedAt&quot; : ISODate(&quot;2022-07-08T19:11:44.730Z&quot;), &quot;__v&quot; : 0 }
  </code></pre>
  <p>But this does not work in my Express app:</p>
  <pre><code> const last = FM_Model.find().limit(1).sort({$natural:-1})
   console.log('Last Token from MONGODB here -&gt; ', last)
  </code></pre>
  <p>In the code above the console.log returns a very long object related to the collection itself, but not the document I want.</p>
  <p>I have tried other variations but nothing has worked so far. If anyone can give me any ideas of what I am missing that would be great.</p>