I'm having two collections collection 'A' and 'B'
In collection 'A' I'm having fields:
Name, School, Class, Rank
In collection 'B' I'm having fields:
FatherName, MotherName, Location
How to add collection 'B' fields FatherName, MotherName, and Location to Collection 'A'
db.A.aggregate( [
{ $project: { _id: 0 } },
{ $merge : { into : "newCollection" } }
] )
This is not giving me derived result. Any better efficient result. Thank you.