As we already known as we don't have table joins in Mongodb
but if we want to get result from 2 different documents than how we can query to Mongodb
? Consider following example.
Document 1 - > department
{Id_:123,name:technical,location:"B Wing"} {Id_:234,name:account,location:"main Wing"} {Id_:547,name:HR,location"C Wing"}
Document 2 - > employee
{Id_:a101,name:Peter,dept_id:234,DOB:2010-01-01} {Id_:a102,name:Liomo,dept_id:547,DOB:1950-01-01} {Id_:a103,name:Juno,dept_id:123,DOB:1990-01-01} {Id_:a104,name:ole,dept_id:554,DOB:2011-01-01}
So how can we get all fields like (EmployeeName
, DepatmentName
, DOB
) in one result, I am not getting any way please help me out
Thanks in advance