MongoDB delete ref collection

MongoDB delete ref collection
0

#1

I find myself in a situation like this:

Collections_1: {

   id
   element
  element
 elemnt: {
 id
ref     collections_2

}

}

collections_ 2: {
id
etc
etc
}

When I want to delete the id element of collections 1 through a link, I want to delete the elements of collections 2 that are inside that specific element from the database, how can I do it?