Im using Mongodb with java and im trying to create a document :
// mongo-java-driver-2.10.1 version
// create a document to store key and value
BasicDBObject document = new BasicDBObject();
document.put("name", "Yassine LD");
BasicDBObject documentDetail = new BasicDBObject();
documentDetail.put("addressLine1", "Sweet Home");
documentDetail.put("addressLine2", "New Street");
documentDetail.put("addressLine3", "CASABLANCA, MOROCCO");
document.put("address", documentDetail);
table.insert(document);
I got this error : The method insert(DBObject[]) in the type DBCollection is not applicable for the arguments (BasicDBObject)