Created
December 8, 2011 15:08
-
-
Save JanPaulEttles/1447221 to your computer and use it in GitHub Desktop.
Updating a document #3
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
| public class DBObjectFactory { | |
| public final static DBObject fromJson(String json) { | |
| DBObject dbo = (DBObject)JSON.parse(json); | |
| ObjectId oid = new ObjectId((String)dbo.get("_id")); | |
| dbo.put("_id", oid); | |
| return dbo; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment