I have these 4 documents
Document 1
{
"First_Name": "dhw",
"Type": "GLAccount",
"Acc_no": 1,
"Last_Name": "irtahow"
}
Document 2
{
"Marks": 13,
"Type": "GLEntry",
"Acc_no": 1
}
Document 3
{
"Marks": 85,
"Type": "GLEntry",
"Acc_no": 1
}
Document 4
{
"Marks": 93,
"Type": "GLEntry",
"Acc_no": 1
}
Now I want to use a sum function Documents 2,3 and 4 and then join it with Document 1. So the result of my query should be like
Acc_no First_Name Last_Name Sum(marks)
1 "dhw" "irtahow" 191
So here you see I want to first sum all the marks of a particular Acc_No and then output its sum of marks and first name and last name.
I am able to sum the marks but not able to simulate the join.