I have the following doc stored in MongoDB:
{
"id" : "5101",
"contractId" : "001",
"dueId" : [{"id":"001"},{"id":"002"}],
"overdueAmount" : "",
"amount" : "",
"customerContact" : "Humus"
}
and I want to update to follow data:
{
"id" : "5101",
"contractId" : "001",
"dueId" : [{"id":"001"},{"id":"002"},{"id":"003"}],
"overdueAmount" : "200",
"amount" : "100",
"customerContact" : "Bim"
}
you can see dueId is updated(insert a element) and amount, overdueAmount, customerContact are also updated.
How can I use mongodb use update?