Click here to Skip to main content
15,905,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have two collection like ,

Student (StudentId,Name,Email,Phone,Address,DepartmentId)

Department( DepartmentId,Name

Note : I have to need this two collection separate.
There will be a relationship between Student & Department collection by DepartmentId.

What I have tried:

I need a student collection with (Name,Email,Phone,Address,DepartmentName)

Can anyone please help me to do this?
Updated 4-May-16 22:21pm

This looks like homework and you don't show any actual code that you have tried.

I think this page will tell you how to do what you want.
MongoDB - Aggregation[^]
Share this answer
Share this answer
OriginalGriff 29-Jun-18 0:18am    
Please do not reopen old questions and post just a link: it looks like abusive behavior we call "rep point farming" and can get you kicked off the site.

In this case, the original question was homework, and after a year it is unlikely to be accepted if the OP hands it in!
In addition, when the solution you propose is just a link it will get you sent to moderation as a probable spammer.

I'm pretty sure that you are neither of these things, but do try to stick to "modern" questions to avoid suspicion in future.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900