query for append id from one collection to array field of document from another collection

12 views Asked by At

In Mongo database I have 2 collections . one users. two accountants . name and family fields are in both . I want to find documents which have name and family equal and add document id from collection accountants to a field array in user document. how can I do this ?

I tried $lookup but I want to add id to array not just show

0

There are 0 answers