title: How to query for objectid on mongodb using python
body: <p>I am trying to print all the object ids in a collection I have in mongoDB. I understand how to convert the <code>ObjectId</code> to a string, however I am not sure how to actually make a call to list all the object ids. </p>
  
  <p>I tried the following from pymongo documentation but nothing happens because I have 4 <code>ObjectId</code>s</p>
  
  <pre><code>def get(post_id):
      Document=client.db.collection.find_one({'_id':ObjectId(post_id)})
      return Document
  </code></pre>