I have a document like below in mongo database and I have corresponding Model class Flight.java with all possible fields that are come in any time as update ?
{
"flight": {
"event": "Leg",
"version": "2",
"key": {
"fltNum": "1111",
"fltOrgDate": "2021-01-12",
"depSta": "BBB",
"dupDepStaNum": "0"
},
"leg": {
"stations": {
"arr": "VVV",
"dupArrStaNum": "0"
},
"times": {
"STD": "2021-01-12T20:30:00",
"STA": "2021-01-12T23:21:00",
"LTD": "2021-01-12T20:30:00",
"LTA": "2021-01-12T23:05:00",
"PTA": "2021-01-12T23:05:00"
},
"status": {
"leg": " ",
"dep": "S",
"arr": "S"
}
}
}
}
So I will get updates for this document continuously with existing fields or some new fields also. I am not sure which filed will get update.
So How can I update document using java MongoDB or Spring Data MongoDB?