Database
[{static1:"abc",static2:"xyz",static3:"asd",nested:[{data1:"d1",data2:"d2",},{data1:"dx",data4:"d4",data5:"d5",data6:"d6",},{data1:"ds",data8:"data8"}]}]
Query
db.collection.aggregate([{$project:{_id:0,data1:1,"nested.data8":1}},{$set:{nested:{$filter:{input:"$nested",cond:{$ne:["$$this",{}]}}}}}])