Just have an question on query to join multiple document together.
For example , i have the following 6 document into same index:
{
"_id" : 1,
"studentId" : "a11",
"class" : "1A",
"classNumber" : 11
},
{
"_id" : 2,
"studentId" : "a11",
"hobby" :"swimming"
},
{
"_id" : 3,
"studentId" : "a11",
"Country" : "USA"
},
{
"_id" : 4,
"studentId" : "b22",
"class" : "1B",
"classNumber" : 50
},
{
"_id" : 5,
"studentId" : "b22",
"hobby" :"cooking"
},
{
"_id" : 6,
"studentId" : "c33",
"Country" : "USA"
}
May i know if i may use DSL query to join the document together based on a key (e.g. "studentId") and become like this?
{
"_id" : 1,
"studentId" : "a11",
"class" : "1A",
"classNumber" : 11
"hobby" :"swimming"
"Country" : "USA"
},
{
"_id" : 4,
"studentId" : "b22",
"class" : "1B",
"classNumber" : 50
"hobby" :"cooking"
},
{
"_id" : 6,
"studentId" : "c33",
"Country" : "USA"
}
Or i need to create a new index? Any other suggestion are welcome.