Aggregating and Visualizing Statistics Using MongoDB and Victory
In this chapter, we are going to learn how to collect, aggregate, and visualize statistics for our blog application using MongoDB and Victory. We start out by learning how we can collect events from users viewing blog posts. Then, we randomly generate some events to have a dataset to work with. We use this dataset to learn how to aggregate data with MongoDB and generate summary statistics, such as the number of views per post, or the average session duration on a post. This kind of information will help authors know how well their posts are doing. Finally, we create some graphs to visualize these aggregated statistics using the Victory library.
In this chapter, we are going to cover the following main topics:
- Collecting and simulating events
- Aggregating data with MongoDB
- Implementing data aggregation in the backend
- Integrating and visualizing data on the frontend using Victory