Hi,
Given documents that look like this:
[
{
id: 10,
aggregation_key: "foo",
timestamp: "2015-08-28"
},
{
id: 20,
aggregation_key: "foo",
timestamp: "2015-08-27"
},
{
id: 30,
aggregation_key: "bar",
timestamp: "2015-08-25"
},
]
Can someone tell me if this is possible with the aggregation api:
I want to group documents together by aggregation_key, and for each set of documents with the same aggregation_key, output the id of the latest document.
So for the above example, it'd return something like:
[
{
"foo": 10,
"bar": 30
}
]
.Carlo