I'm newbie for manipulating MongoDB recently, but I really need to update some fields like these..
db_name: test
table_name: info
{
"_id" : ObjectId("54bf9ab4f8eda6747567b122"),
"archives" : [
{
"evalution" : {
"positive" : 0,
"undefine" : 0,
"negative" : 0
},
"source" : ObjectId("54cb6f455decd8037528756b")
}
]
}
I want to increase positive and undefine by 1, and if evalution doesn't exists,
"evalution" : {
"positive" : 0,
"undefine" : 0,
"negative" : 0
}
should be added to the object.
I don't know if I express myself clearly, but I really need some help..
archivesarray?positiveandundefineinevalutionevaluationattribute. So you want to updatepositiveandundefineof all the elements?"_id" : ObjectId("54bf9ab4f8eda6747567b122")