With a myriad of visualization tools available, it is hard to find the right one for MongoDB data which has out-of-the-box functionality.

有了众多可用的可视化工具,很难为具有现成功能的MongoDB数据找到合适的工具。

Today, I want to tell you about my experience in exploring such visualization tools.

今天,我想向您介绍我在探索这种可视化工具方面的经验。

My goal was to analyze a dataset from a MongoDB database. I wanted to work out a workflow for data analysis which combines database management analysis, data aggregation and data visualization.

我的目标是分析MongoDB数据库中的数据集。 我想制定一个数据分析工作流,它将数据库管理分析,数据聚合和数据可视化相结合。

Here are the tools I’ve chosen:

这是我选择的工具:

  • Compass is a GUI application for in-depth analysis and visualization of MongoDB data and a collections’ schema. It provides a real-time view of your data. The intuitive interface helped me to focus on the meaning of data.

    罗盘 是一个GUI应用程序,用于对MongoDB数据和集合的模式进行深入的分析和可视化。 它提供了数据的实时视图。 直观的界面帮助我专注于数据的含义。

  • Flexmonster Pivot Table is a tool for advanced web reporting and analysis. While Compass is a stand-alone application, I’ve discovered that Flexmonster is integrated directly into the web project. I’ve managed to embed it into my Angular 4 application and used it for data analysis.

    Flexmonster数据透视表是用于高级Web报告和分析的工具。 尽管Compass是一个独立的应用程序,但我发现Flexmonster直接集成到了Web项目中。 我已经设法将其嵌入到Angular 4应用程序中,并将其用于数据分析。

The first part of the visualization process is to set up a connection to a MongoDB database with Compass. Then you can explore what functionalities Compass offers and what analysis you can conduct using this tool.

可视化过程的第一部分是使用Compass建立与MongoDB数据库的连接。 然后,您可以探索Compass提供的功能以及可以使用此工具进行的分析。

The second part is dedicated to further MongoDB data analysis. We will load data into a pivot table and explore the possibilities this offers.

第二部分致力于进一步的MongoDB数据分析。 我们将数据加载到数据透视表中,并探索此功能的可能性。

As a data source for my research, I’ve chosen a dataset on 120 years of Olympic history and results.

作为研究的数据源我选择了120年奥运会历史和结果数据集

This dataset has a typical JSON structure which is different from the format required by MongoDB. To import this into MongoDB, I’ve executed the following command in the CLI:

该数据集具有典型的JSON结构,该结构与MongoDB所需的格式不同。 要将其导入MongoDB,我在CLI中执行了以下命令:

mongoimport - db <db-name> - collection athletes - type json - file athletes.json
 - jsonArray

使用指南针了解数据 (Understanding the Data with Compass)

At first, I’ll mention some database management features.

首先,我将介绍一些数据库管理功能。

Compass is able to generate histograms to represent the data frequency. This helped me to analyze the presence of documents, data types and the distribution of values for specific fields within the collection.

指南针能够生成直方图来表示数据频率。 这帮助我分析了文档中是否存在,数据类型以及集合中特定字段的值分布。

First of all, I connected to the MongoDB instance running on localhost using the Compass application.

首先,我使用Compass应用程序连接到在本地主机上运行的MongoDB实例。

On the main page of the “athletes” collection, I’ve checked the information about the collection, edited the data in an interactive mode and tried out simple and complex queries.

在“运动员”集合的主页上,我检查了有关集合的信息,以交互方式编辑了数据,并尝试了简单和复杂的查询。

A schema visualization tool helped me understand my data.

模式可视化工具 帮助我了解了我的数据。

Here I’ve checked the statistics on fields’ data types: the percentage of data types used for this field in all the documents within the collection.

在这里,我检查了字段数据类型的统计信息:该字段在集合中所有文档中使用的数据类型的百分比。

I’ve identified that I have mixed data types for some fields. In my example, I have a numerical type for ‘Height’ in 80% of documents, but a string type appears in 20% of cases.

我确定我在某些字段中使用了混合数据类型。 在我的示例中,我的数字类型为“高度” 在80%的文档中,但在20%的案例中出现字符串类型。

For me, that meant that there is a gap in my dataset. The height is stored differently between athletes.

对我而言,这意味着我的数据集存在差距。 运动员之间的身高存储方式不同。

指南针聚合 (Aggregation with Compass)

What features make MongoDB and Compass so popular among data analysts who often work with semi-structured and unstructured data?

哪些功能使MongoDB和Compass在经常使用半结构化和非结构化数据的数据分析师中如此受欢迎?

MongoDB is useful for real-time analytics because it supports aggregation pipelines. These can include sorting and filtering operations, and grouping the data.

MongoDB对实时分析很有用,因为它支持聚合管道。 这些可以包括排序和过滤操作,以及对数据进行分组。

While Compass supports real-time query building for aggregation.

而Compass支持实时查询构建聚合。

To focus on specific portions of the data, I’ve filtered the documents by the ‘Age’ field.

为了专注于数据的特定部分,我已经按“年龄”字段过滤了文档。

To show only those athletes under 22 years old, I’ve selected the necessary area on the histogram to construct a query on ‘Age’ field. As a result, the matching documents have been returned.

为了只显示22岁以下的运动员,我在直方图中选择了必要的区域以构建“年龄”字段的查询。 结果,匹配的文档已被退回。

In the same way, I’ve filtered by the range of values. Then I’ve sorted the data by ‘Age’ in ascending order:

同样,我按值范围过滤。 然后,我按升序对数据进行了排序:

But to build stages in the aggregation pipeline and group the data, I needed to use my knowledge of MongoDB query language. It was easier to do in the pivot table.

但是,为了在聚合管道中构建阶段并对数据进行分组,我需要使用对MongoDB查询语言的了解。 在数据透视表中这样做更容易。

使用Flexmonster数据透视表分析数据 (Analyzing the Data with Flexmonster Pivot Table)

In my web projects, I use Angular. So, I followed an Angular tutorial to embed the pivot table. To get the data from my database I’ve used this tutorial.

在我的Web项目中,我使用Angular。 因此,我遵循了Angular教程来嵌入数据透视表。 为了从数据库中获取数据,我使用了本教程

I’ve connected to MongoDB from my application and retrieved the data about athletes. The data was compressed and then passed to the pivot table for visualization.

我已经从应用程序连接到MongoDB,并检索了有关运动员的数据。 数据被压缩,然后传递到数据透视表以进行可视化。

After loading the sample data about athletes into the pivot table, I wanted to analyze the minimum and maximum age among the athletes. Additionally, I wanted to define the best teams in history based on their total medals quantity.

将有关运动员的样本数据加载到数据透视表后,我想分析运动员的最小和最大年龄。 另外,我想根据奖牌总数来确定历史上最好的球队。

To start the data analysis, I selected fields to columns and rows.

为了开始数据分析,我选择了列和行的字段。

To work with the ‘Medal’ field, I’ve selected it to measures and achieved the following results:

为了与“奖牌”字段一起使用,我选择了它进行测量并获得以下结果:

  1. Filtered the records by value to display the top 5 teams with the highest quantity of medals

    按值过滤记录,以显示奖牌数量最多的前5名球队
  2. Applied conditional formatting for my report to highlight teams which have more than 185 medals.

    为我的报告应用了条件格式,以突出显示拥有185枚以上奖牌的团队。

3. Next, I’ve selected ‘Age’ and analyzed the maximum age among the athletes:

3.接下来,我选择了“年龄”并分析了运动员的最大年龄:

4. Then I’ve switched to the pivot charts and analyzed the data in a more visual manner to learn about the best teams in the summer season:

4.然后,我切换到数据透视图并以更直观的方式分析数据,以了解夏季的最佳团队:

结论 (Conclusion)

So, today I’ve shared my experience of using Compass and Flexmonster Pivot Table. To my mind, both tools are able to help in making a creative visual story and analyze the data in a smart way.

因此,今天我分享了使用Compass和Flexmonster数据透视表的经验。 在我看来,这两种工具都可以帮助制作富有创意的视觉故事并以智能方式分析数据。

I do hope you’ve found reading about my experience useful and now you are on the right path to successful MongoDB data analysis.

我希望您发现对我的经验的阅读对您有所帮助,现在您已走上成功进行MongoDB数据分析的正确道路。

I will be happy to hear any feedback on this overview. Please, give your opinion in the comments. What tools for MongoDB data visualization could you recommend? Do they handle and process your data well?

我很高兴听到对此概述的任何反馈。 请在评论中发表您的意见。 您可以推荐哪些用于MongoDB数据可视化的工具? 他们是否能够很好地处理和处理您的数据?

翻译自: https://www.freecodecamp.org/news/mongodb-data-visualization-tools-565000c7309/

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐