Looking for MongoDB Expert to help create query for report.
$10-30 USD
Completed
Posted almost 7 years ago
$10-30 USD
Paid on delivery
I need someone to help create a query for report page views for the month in from highest to lowest:
One user Access Record:
{
"_id": "5x4YuEM3Ydj_C-YN",
"_class": "[login to view URL]",
"userPages": {
"a3cbb34de70e2a3a69111b92f3bdc746": "url1",
"94122ef86438464817bfb426564e836b": "url1/[login to view URL]"
},
"expiresTimestamp": {
"$date": "2017-11-15T12:38:37.318Z"
}
}
User Page History
"_id": "dRA_V3UuP-cehgfL*site_tk_9tOSAsjwqpgrG0I5",
"_class": "[login to view URL]",
"entryTime": 0,
"userAccessBoundary": "dRA_V3UuP-cehgfL*site_tk_9tOSAsjwqpgrG0I5",
"userEntries": {
"1499945100682": "a86dc49051300046cf8a78a8e118e027",
"1500262884108": "98631644265d33b64274c9a0e0a004f2"
},
"expiresTimestamp": {
"$date": "2017-08-12T11:25:00.682Z"
}
}
User page has a bunch of entries, the value to those entries are actually the keys in user access record collection which are unique pages visited by that user.
User page history id after * is a what we want to group by in this case: site_tk_9tOSAsjwqpgrG0I5
For All the user page history record who's id has this site_tk_9tOSAsjwqpgrG0I5,
We want to get all the count of unique pages. and get them in order for high to low, also based on the month ( expiresTimestamp ).