I have 2 tables in MongoDb, Both are related to each other.
For example Employee
and Department
. Employee
is related to Department
.
Employee
{
'_id' : ID_OF_EMPLOYEEE,
'Name' : NAME_OF_EMPLOYEEE
'dept_id' : ID_OF_EMPLOYEES_DEPT
}
DEPT
{
'_id' : ID_OF_EMPLOYEEE,
'Name' : NAME_OF_DEPT
}
Now, I want to create a YII Relation which will give me name of Employee's
Department
(Like what we do in Relation DB). it should look like
$dept = $employee->department
Please give me a solution
Thanks.