'how to search or find the data into array and also again into array mongodb

how to find the data into arrays of arrays. I want to find data that is stored in the array. When we got the data and send response with parent id. here schema

 1 parent object{
    1boj child object,   // here I want to find data. that exists here and give the result with parent id or also child id
    2obj,
    3obj
    }
    2object{}
    3object{}

I am quiring like this

 const data = Course.find({'_id':{$elemMatch:{$elemMatch:{$in:[id]}}}}) finding this anywhere .


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source