My doc is like this
"page_elements" : [
{
"type" : "gallery",
"words" : [
"gallery",
"photos"
]
},
{
"type" : "cart",
"words" : [
"cart",
"shop"
]
},
{
"type" : "Privacy",
"words" : [
"privacy",
"policy",
"privacy policy"
]
},
{
"type" : "cart",
"words" : [
"cart",
"shopping cart",
"buy now",
"add to cart",
"add to basket"
]
}
by mistake, I've updated cart two times. now, i need to remove the first cart in the array and keep the rest of the document.
Here, I need to delete
{
"type" : "cart",
"words" : [
"cart",
"shop"
]
}
I tried this..
db.ds_master_language_words.remove( { "page_elements.type" : "cart" } )
.remove()method that is wrong here.