I have a one to many relationship of two Collections say A to B. How can I i show the desired output in one document for each id.
For example, I have
/Collection A/
{
“a_Id”: “abc”,
“name”: “xyz”,
“age”: 5
}/Collection B/
{
“b_id”: “abc”,
“FeeAmount”: 800000,
“invoiceNumber”: “A10”,
“Date”: “2021-10-29T00:00:00.000+04:00”,
“PaidAmount”: 200000
},
{
“b_id”: “abc”,
“FeeAmount”: 90,
“invoiceNumber”: “A20”,
“Date”: “2021-10-29T00:00:00.000+04:00”,
“PaidAmount”: 20
}
How can I achieve the following output after lookup on base of id?
This is 1 document per id
/Desired OutPut/
{
“name”: “xyz”,
“age”: 5
“availableLimitAmount”: 800000,
“FeeAmount”: 800000,
“invoiceNumber”: “A10”,
“Date”: “2021-10-29T00:00:00.000+04:00”,
“PaidAmount”: 200000
},
{
“name”: “xyz”,
“age”: 5
“FeeAmount”: 90,
“invoiceNumber”: “A20”,
“Date”: “2021-10-29T00:00:00.000+04:00”,
“PaidAmount”: 20
}