Java Mongodb BasicDBObject Example

Storing Java Object in Mongodb

Java Mongodb driver basically gives you to options when storing data in MongoDB . Either subclass BasicDBObject which is the general database object, or implement the DBObject interface.Example BasicDBObject contact = new BasicDBObject(); contact.put("name", "pretech"); contact.put("address", "bangalore"); or public class xxx extends BasicDBObject and put the values