I am new at MongoDB and I want to insert to mongodb data like this but I couldn\'t figure out how
{ image = \"cab\" tags = [ [ \"NNP\", 0 ],
Did you mean like this?
BasicDBObject obj = new BasicDBObject(); obj.put("image", ....); for(Tag tag:tags){ BasicDBObject tagsObj = new BasicDBObject(); tagsObj.put("NNP",tag.getNNP()); tagsObj.put("NN",tag.getNN()); obj.put("tags",tagsObj); }