Skip to content

Instantly share code, notes, and snippets.

@dalmat36
Created April 3, 2015 16:17
Show Gist options
  • Select an option

  • Save dalmat36/7dc82067effc9593c6d8 to your computer and use it in GitHub Desktop.

Select an option

Save dalmat36/7dc82067effc9593c6d8 to your computer and use it in GitHub Desktop.
This code snippet creates three bson documents that can be inserted into the MongoDB "people" collection
//Insert three famous person documents
//Top 3 from http://www.biographyonline.net/people/famous-100.html
Document person1 = new Document("First Name", "Marilyn")
.append("Last Name", "Monroe");
Document person2 = new Document("First Name", "Abraham")
.append("Last Name", "Lincoln");
Document person3 = new Document("First Name", "Mother")
.append("Last Name", "Teresa");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment