Get overall count
Hey there,
I want to get the overall count, so suppose I have the following documents
{
"_id" : "no-segment_2019:12",
"d" : {
"10" : {
"12" : {
"c" : NumberInt(3)
},
"c" : NumberInt(3)
}
},
"m" : "2019:12",
"s" : "no-segment"
},
{
"_id" : "no-segment_2019:12",
"d" : {
"28" : {
"11" : {
"c" : NumberInt(2)
},
"c" : NumberInt(2)
}
},
"m" : "2019:11",
"s" : "no-segment"
}
How do I get the 5
(starting with common.db.collection()
). I searched for "flattening the query" and found this, but it requires fields to have same names (which is not given due being dependent on the date).
Thanks in advance!
Comments
This is standard aggregated data model in Countly.
Main point for it, to load initial data into dashboard and then to refresh, query only last our or last day data, etc
In most cases you would not want to mangle with it to make it work as you want, as procedure is quite complex.
It should be enough for you to get aggregated data in normal format
You can use:
https://resources.count.ly/v1.0/reference#oanalyticssessions
https://resources.count.ly/v1.0/reference#oanalyticsmetric
https://resources.count.ly/v1.0/reference#oanalyticsevents
For Enterprise edition you can also use:
https://resources.count.ly/v1.0/reference#omethodsegmentation
which would allow you to also query data from mongodb like calculate data for specific segments, or break down data by specific segments.
Please sign in to leave a comment.