Created
April 3, 2015 16:41
-
-
Save dalmat36/a3a941ef23dd7c3f911f to your computer and use it in GitHub Desktop.
This code snippet finds all people documents in the "people" collection and prints them to the console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static void printAllPeople(){ | |
| MongoCursor<Document> people = collection.find().iterator(); | |
| while(people.hasNext()) | |
| System.out.println(people.next()); | |
| System.out.println("\n"); | |
| people.close(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment