Database

db={"User":[{"id":123,"name":"X","type":"regular"},{"id":456,"name":"Y","type":"regular"}],"UserHistory":[{"id":123,"usage":36,"balance":11,"month":"SEP"},{"id":123,"usage":20,"balance":12,"month":"OCT"},{"id":123,"usage":30,"balance":32,"month":"NOV"},{"id":123,"usage":10,"balance":32,"month":"NOV"}]}

Query

db.User.aggregate([{"$match":{"id":123}},{$lookup:{from:"UserHistory",localField:"id",foreignField:"id",as:"history"}},{"$addFields":{"history":{"$filter":{"input":"$history","as":"h","cond":{"$gte":["$$h.usage",18]}}}}}])

Result