Еквивалент на java драйвер.
List<DBObject> criteria = new ArrayList<DBObject>();
criteria.add(new BasicDBObject("totalmarks", new BasicDBObject("$ne", 10)));
criteria.add(new BasicDBObject("totalmarks", new BasicDBObject("$ne", 15)));
DBCursor dbCursor = collection.find(new BasicDBObject("$and", criteria));