Database

[{title:"test",content:"content",comments:[{content:"level2",likes:3,subComments:[{parentCommentId:"1",content:"level3",likes:3,},],},{content:"level2",likes:3,subComments:[{parentCommentId:"1",content:"level3",likes:5,},{parentCommentId:"1",content:"level3",likes:5,}]}]}]

Query

db.collection.find({},{title:1,content:1,comments:{$filter:{input:{$map:{input:"$comments",as:"comment",in:{content:"$$comment.content",subComments:{$filter:{input:"$$comment.subComments",as:"subComment",cond:{$gt:["$$subComment.likes",3]}}}}}},cond:{$ne:["$$this.subComments",[]]}}}})

Result