Created
June 25, 2015 13:58
-
-
Save dmregister/31bdfc3e903bbd7f3cfa to your computer and use it in GitHub Desktop.
get mongo id from an update
This file contains 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
BasicDBObject doc = new BasicDBObject( "name", "Matt" ); | |
collection.insert( doc ); | |
ObjectId id = (ObjectId)doc.get( "_id" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment