Greetings:
I like to know how to update an existing collection in mongodb. The issue is that I have the following structure
Code:
{
    facultad_id  : "number",
    departamentos:
          [
               { profesores: [ ] }

          ]
}

That's the existing structure but I have a query that just update the profesores collection but it is not workin because it duplicates the departmento entry. That means it doesn't update the existing items by id, as result it gets dupe. On element with the info of the departamento and other element with the same id and the collection of profesores. I share my document helps if I am doing something wrong. I am usig pdi8


Name Mongo document path Use field name NULL values JSON Match field for update Modifier operation Modifier policy
facultad_id id N Ignore N Y N/A Insert&Update
departmento_id departmento[0].id N Ignore N N $set Insert
departmento_id_id departmento[0].id N Ignore N N $push Update
id departmento[0].profesor[0].id N Ignore N N $set Insert
id departmento[0].profesor[0].id N Ignore N N $push Update
isActive departmento[0].profesor[0].open N Ignore N N $set Insert
isActive departmento[0].profesor[0].open N Ignore N N $push Update
date departmento[0].profesor[0].date N Ignore N N $set Insert
date departmento[0].profesor[0].date N Ignore N N $push Update