I have a collection that replays with the data below when i get all documents. But i would like to add a custom "grouping" to it so it looks like example 2 below. And i though you could do it by using Population but im not getting it to work..
Original json
[
{
"id" : "...",
"category" : "...",
"header" : "...",
"body" : "..."
},
{
"id" : "...",
"category" : "...",
"header" : "...",
"body" : "..."
}
]
What i want:
{
"offers" : [ {
"id" : "...",
"category" : "...",
"header" : "...",
"body" : "..."
},
{
"id" : "...",
"category" : "...",
"header" : "...",
"body" : "..."
}]
}