We have a very complex collection structure. I want to delete an entry from it. I am new to mongodb.
The sample collection is as follows,
{
"rootid": "1",
"projects": [
{
"projectId": "2",
"proxies": [
{
"proxyId": "4",
"config": {
"pipeline": [
{
"pipelineId": "12",
"desc": "pipeline"
},
{
"pipelineId": "14",
"desc": "pipeline1234"
}
]
}
}
]
}
]
}
I want to delete an entry from pipeline embedded collection, if it matches the criteria.
Example:
if "rootid": "1" ,"projectId": "2", "proxyId": "4", "pipelineId": "12" then I want to delete first entry from pipeline array.
We are using spring boot as a framework. If some one helps with mongo query I will try to convert it with spring mongoTemplate.
Thanks in advance,