The scenario is like: I want to append more rows to list in document. The pojo used for holding data to save in mongodb is like this
public class ViewModelOESLog {
private String id;
private List<OESLog> oesLogList;
private List<OESExamLog> oesExamLogList;
int uploadStatus;
//getter and setter
}
As shown in pojo,document will have structure like id
, oesLogList
and OesExamLoglist
and uploadstatus
.
During Update,I want to add more rows to oesLogList,consider now oesLogList has rows[0],[1],[2] I want to add more records to this list.
I have tried collection.save()
,but it replaces the old one.
As i am new to Mongodb,please suggest if I can achieve this or not.If yes then how?