Database

db={"clients":[{"_id":1,"type":"personal","name":"Tom","createAt":ISODate("2022-01-10T11:23:25.184Z")},{"_id":2,"type":"business","name":"Apple","createAt":ISODate("2022-01-12T05:10:42.220Z")}],"accounts":[{"_id":1,"client_id":1,"type":"saving","money":12000},{"_id":2,"client_id":1,"type":"checking","money":8000},{"_id":3,"client_id":2,"type":"checking","money":6000},{"_id":4,"client_id":2,"type":"checking","money":7000}]}

Query

db.clients.aggregate([{"$lookup":{"from":"accounts","localField":"_id","foreignField":"client_id","as":"account_docs"}}])

Result