Skip to content

Instantly share code, notes, and snippets.

@kerbymart
Created May 14, 2013 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerbymart/5577186 to your computer and use it in GitHub Desktop.
Save kerbymart/5577186 to your computer and use it in GitHub Desktop.
Mungo mungo = new Mungo();
DB testDB = mungo.getDB("testDB");
DBCollection messages = testDB.createCollection("Message");
BasicDBObject obj
= new BasicDBObject("{\"hello\" : \"world\"}")
.append("hi", "there");
.append("good", "morning");
WriteResult wr = messages.insert(obj); // Done!
Greeting greeting = messages.findOne(obj.getId()).as(Greeting.class); // Get it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment