Suppose I have two collections in Mongodb say Col_1 and Col_2. Format for Col_1:
{
"_id":"",
"Field_1":"abc",
"Field_2":"color"
},
{
"_id":"",
"Field_1":"red"
"Field_2":"fruits"
}
And the format of Col_2 is: {
"_id":"",
"Field_1":"xyz abc orange red",
"Field_2":"799842",
"Field_3":""
}
{
"_id":"",
"Field_1":"xyz abc orange red",
"Field_2":"4743893",
"Field_3":""
}
I want to compare the field1 of Col_1 with the field1 of Col_2 and update the Field3 of Col_2 with the field2 of Col_1.
Suppose if we apply the find command and it returns with the matched documents I want to update those.Can I perform this on shell or I need to use some programming language?