Created
November 11, 2011 00:08
-
-
Save esedor/1356703 to your computer and use it in GitHub Desktop.
Querying MongoDB in Java
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
locations = database.getCollection("locations"); | |
locations.insert(new BasicDBObject("name", "Arganis")); | |
locations.update(new BasicDBObject("name", "Arganis"), | |
new BasicDBObject("$set", | |
new BasicDBObject("leader", | |
"King Argan III"))); | |
DBCursor results = locations.find(new BasicDBObject("leader", "King Argan III")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment