Hello - I am using a MongDB database with a referenced ObjectId to another object in another table.
To query the record, I'm using an aggregate lookup:
[
{ "$match": {
"CongNo": {{localStorage.values.Congregation.CongNo}},
"Status": {$regex:"{{ selectFilterRequestsStatus.value == null ? "" : selectFilterRequestsStatus.value }}"}
}
},
{"$lookup": {from:"Territories", localField:"No", foreignField:"_id", as:"No"}},
{"$unwind": "$No" },
{"$lookup": {from:"Users", localField:"User", foreignField:"_id", as:"User"}},
{"$unwind":"$User"}
]
Here's an example of what is returned:
All looks good. However, when I populate the table with the results, the referenced column shows blank:
The selection menu options are correct and it even saves correctly, but when the table loads, it doesn't display the current selected value or array.
I'm guessing I need to run a transform on the table data aggregate lookup query but am not sure how to do that. Any help? Thank you in advance.