So the problem is:
I have next structure:
"details" : {
"2015-08-17" : {
"date" : ISODate("2015-08-17T08:15:05.479Z"),
...
},
"2015-08-18" : {
"date" : ISODate("2015-08-17T08:15:05.479Z"),
...
},
...
}
I have to get all date
fields. How can I got it?
I need solution with aggregation framework, because do it by cursor spend much more time (sure, I can use forEach
and then with for
get all that I need, but it's not a good idea).
I found solution with $objectToArray link, but I have only mongo version 3.2
. So I want very much to see you advices ;) and will be very grateful.
UPDATE
THE QUESTION: how can get list of dates like below?
{
dates: [
ISODate("2015-08-17T08:15:05.479Z"),
ISODate("2015-08-17T08:15:05.479Z"),
ISODate("2015-08-17T08:15:05.479Z"),
...
]
}