I have 2 collections, collection A has some documents like {'id':1,'field':'name'}
,{'id':1,'field':'age'}
,and collection B has some documents like
{'_id':1,'name':'alice','age':18,'phone':123}
,{'_id':2,'name':'bob','age':30,'phone':321}
and I want to find all the document whose '_id' is in collectionA, and just project the corresponding field.
for example:
collection A
{'id':1,'field':'name'},
{'id':1,'field':'age'}
collection B
{'_id':1,'name':'alice','age':18,'phone':123},
{'_id':2,'name':'bob','age':30,'phone':321}
the result is:
{'name':'alice','age':18},
I don't know if there is an easy way to do that?