I am trying to print all the object ids in a collection I have in mongoDB. I understand how to convert the ObjectId to a string, however I am not sure how to actually make a call to list all the object ids.
I tried the following from pymongo documentation but nothing happens because I have 4 ObjectIds
def get(post_id):
Document=client.db.collection.find_one({'_id':ObjectId(post_id)})
return Document