I want to make a function deleteEmployee(String companyName, String departmentName, String employeeName);
Its job is to delete an employee item of the employees list inside a departments array which is inside a company entry. The structure of the BSON is as follows :
{
"name" : "company1" ,
"departments" : [
{
"name" : "science" ,
"employees" : [
{
"name" : "alex"
} ,
{
"name" : "john"
}
]
} ,
{
"name" : "arts" ,
"employees" : [
{
"name" : "bob"
} ,
{
"name" : "david"
}
]
}
]
}
How is that possible?