Database
[{"id":1,"ref":null,"date":"20-09-2020"},{"id":2,"ref":1,"date":"today"},{"id":3,"ref":null,"date":"today"}]
Query
db.collection.aggregate([{"$addFields":{"date1":{"$cond":{"if":{"$eq":["$date","today"]},"then":new Date(),"else":{"$toDate":"$date"}}}}},{"$lookup":{"from":"collection","localField":"id","foreignField":"ref","as":"output"}},{"$match":{"date1":{"$lte":ISODate("2020-10-01T00:00:00Z")}}}])