AnsweredAssumed Answered

MongoDB OutPut complex documents

Question asked by felix romero on Jan 25, 2018

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

 

 

 

Outcomes