title: MongoDB: How to get timestamp and ObjectID from newest document in collection?
body: <p>I would like to get last created documents in collection and return their objectID and timestamps. For example if yesterday I created 10 documents I would like to return them with db.collection and then </p>
  
  <pre><code>const lastTimeStamp = will be the timestamp from the last created element
  
  const lastTimeStampArray = will be array of timestamps from yesterdays records
  
  const lastObjectId = will be ObjectID of last created document
  
  const lastObjectIdsArray = array of last objectIds
  </code></pre>
  
  <p>I am using:</p>