{
"_id" : ObjectId("568501dd4b1eaa529a40c3b7"),
"Thought" : [
{
"thread_id" : "f6a678ed8e45ab22f258020530ddaafc",
"th_username" : "Vipul",
"th_email" : "abc@abc.com",
"th_text" : "original thought",
"th_image" : "",
"likes" : NumberInt(0),
"liked_user" : [],
"th_inserted_at" : "18-01-2016 13:31:45",
"Comments" : [
{
"comment_id" : "f30937a4e12b0b7c975c172767ce7713",
"cmt_from_id" : "5509dc6dcf5b5b7b8f95f23f041886d3",
"commenter_name" : "Vipul Masurkar",
"commenter_email" : "abc@abc.com",
"comment_txt" : "hello comment",
"cmt_likes" : 2.0,
"cmt_liked_user" : [
],
"cmt_inserted_at" : "18-01-2016 13:31:54"
}
]
}
]
}
This is my Document and I want to replace Thought.Comments.cmt_likes
from 2.0 to something of my wish (eg 4.0)
I can't use $
operator twice so I can't use $inc
to increment the value.
Is there any way to modify the nested array fields? If not possible then can I do it through php atleast?
Thank You