I have the following document structure:
{
"user_id": "102",
"roles": [{
"name": "superuser"
}, {
"name": "admin"
}, {
"name": "account_admin"
}]
}
And I need to unwind into the following result:
{
"user_id": "102290863723817866607",
"roles": [
0: "superuser",
1: "gsuite_admin",
2: "account_admin"
]
}
I can't quite figure out how to stage the aggregation pipeline to get this result