mongodb get all documents in collection java code example Example: get all data in collection mongodb db.collection_name.find().pretty()