Merging of indices


(Arcadix Infotech Pvt.Ltd) #1

Hi

Student
=======
{
	"StudentId":1,
	"StudentName":"abc"
}

Subject
=======
{
	"SubjectId":101,
	"SubjectName":"English"
},
{
	"SubjectId":102,
	"SubjectName":"Science"
}


SubjectAssigned
===============
{
	"SubjectId":101,
	"StudentId":1
},
{
	"SubjectId":102,
	"StudentId":1
}


Student+SubjectAssigned (Need something like this as result)
=======================

{
	"StudentId":1,
	"StudentName":"abc"
	"Subjects":[
		{
			"SubjectId":101,
			"SubjectName":"English"
		},
		{
			"SubjectId":102,
			"SubjectName":"Science"
		}
	]
}

Please suggest some solution to do this.

Thanks
Aneesh L


(David Pilato) #2

This is a duplicate of Merge data fer two indices with foreign key. Please keep the discussion there.


(David Pilato) #3