Delete1
2
3
4
5
6
7
8
9
10Mongo mg = new Mongo("localhost", 27017);
// get db
db = mg.getDB("CRUD");
// get collection
dc = db.getCollection("test");
//Delete
DBObject doc = dc.findOne();
WriteResult result = dc.remove(doc);
System.out.println("Number of documents are deleted : " + result.getN());
1 | // delete |