I have the following document structure:
{
_id: ...,
name: "Item1",
Props: [
{
Key: "numberKey",
Val: 1234
},
{
Key: "dateKey",
Val: Date("2013-09-09")
}]
}
This is simplified and there can be various Keys and Values in Props field in the real application.
My question - is it possible to $group and $sum "numberKey"s by "dateKey"s?
What structure should I use if this is not possible? I need users to let add keys and values so I need something flexible.