I want to insert array in already exist documents .
now my document look like this:
{
"_id" : ObjectId("5604f0150fe136e9292ee16a"),
"name" : "mamy",
"url_Address" : "http://www.flipkart.com/mamy-poko-pants-diaper-large/p/itmdbdffn8gjzpfz?pid=DPRDADE2Z8BZGYZG&ref=L%3A-2196533682561335257&srno=p_1&query=mamy&otracker=from-search",
"vendor_Name" : "WS Retail",
"vendor_rating" : "4.2 / 5",
"last_price_1" : "Rs. 699",
"last_price_2" : "Rs. 699",
"prce" : "Rs. 699",
"product_Name" : "Mamy Poko Pants Diaper - Large",
"MRP" : "Rs 573"
}
and i want to add an array in this with name competitor :
{
"_id" : ObjectId("5604f0150fe136e9292ee16a"),
"name" : "mamy",
"url_Address" : "http://www.flipkart.com/mamy-poko-pants-diaper-large/p/itmdbdffn8gjzpfz?pid=DPRDADE2Z8BZGYZG&ref=L%3A-2196533682561335257&srno=p_1&query=mamy&otracker=from-search",
"vendor_Name" : "WS Retail",
"vendor_rating" : "4.2 / 5",
"last_price_1" : "Rs. 699",
"last_price_2" : "Rs. 699",
"prce" : "Rs. 699",
"product_Name" : "Mamy Poko Pants Diaper - Large",
"MRP" : "Rs 573",
"Competitor : [{
"cat_id" : "xx",
"name" : "mamy",
"url_Address" : "http://www.flipkart.com/mamy-poko-pants-diaper-large/p/itmdbdffn8gjzpfz?pid=DPRDADE2Z8BZGYZG&ref=L%3A-2196533682561335257&srno=p_1&query=mamy&otracker=from-search",
"vendor_Name" : "WS Retail",
"vendor_rating" : "4.2 / 5",
"last_price_1" : "Rs. 699",
"last_price_2" : "Rs. 699",
"prce" : "Rs. 699",
"product_Name" : "Mamy Poko Pants Diaper - Large",
"MRP" : "Rs 573"
},
{
"cat_id" : "xxx",
"name" : "mamy",
"url_Address" : "http://www.flipkart.com/mamy-poko-pants-diaper-large/p/itmdbdffn8gjzpfz?pid=DPRDADE2Z8BZGYZG&ref=L%3A-2196533682561335257&srno=p_1&query=mamy&otracker=from-search",
"vendor_Name" : "WS Retail",
"vendor_rating" : "4.2 / 5",
"last_price_1" : "Rs. 699",
"last_price_2" : "Rs. 699",
"prce" : "Rs. 699",
"product_Name" : "Mamy Poko Pants Diaper - Large",
"MRP" : "Rs 573"
}]"
}
what query i have to write in mongodb ?
what query i have to write in Nodejs ?