Database
[{"_id":ObjectId("61e53553ac31665894ebf6bc"),"questionID":"8","questionContent":"find it","questoinAnswer":"it's here","questionStatus":"active","questionImage":"some image","hints":[{"hintID":"1","hintSubject":"in you pucket","hintContent":"bla bla bla","hintType":"free","hintStatus":"Active","time":"2022-01-23 11:02:41.976391"},{"hintID":"1","hintSubject":"ergrg you pucket","hintContent":"bla bla bla","hintType":"free","hintStatus":"Active","time":"2022-01-23 11:02:41.976391"},{"hintID":"2","hintSubject":"red sea","hintContent":"bla bla bla","hintMedia":"some media","hintType":"puplic","hintStatus":"Active","time":"2022-01-23 11:05:47.567226"}]}]
Query
db.collection.aggregate([{"$addFields":{"hintSubject":{"$reduce":{"input":"$hints","initialValue":[],"in":{"$concatArrays":["$$value",{"$cond":{"if":{"$and":[{"$eq":["$$this.hintType","free"]},{"$eq":["$$this.hintStatus","Active"]},]},"then":["$$this.hintSubject"],"else":[],},},],},},}}}])