Over a million developers have joined DZone.

Analyzing Stack Overflow Developers Survey Dataset With MongoDB Charts

DZone 's Guide to

Analyzing Stack Overflow Developers Survey Dataset With MongoDB Charts

MongoDB Charts is a great tool for analyzing and visualizing your datasets. Read on for quick run through of how to work with MongoDB Charts!

· Big Data Zone ·
Free Resource

Visualizations allow understanding and communicating your data to find patterns and trends within your datasets. MongoDB Charts is a visualization tool to create meaningful visualization of your MongoDB data.

Why MongoDB Charts?

The existing ways to visualize and analyze your MongoDB data is writing your own custom code to visualize data sitting in MongoDB or exporting MongoDB data to external ETL pipelines and visualize it using BI tools or use MongoDB connectors to export MongoDB data in BI tools and create visualizations. Using MongoDB charts allows you to take advantage of built-in aggregation frameworks and preserves the richness of your data using nested arrays and objects in your charts.

Setting Up Your Environment

This hands-on tutorial involves setting up working components to analyze Stack Overflow 2018 Developer Survey data using MongoDB charts:

  1. MongoDB Server (Running on your local machine, AWS EC2 or MongoDB Atlas): Guide
  2. MongoDB Charts Application (Runs inside a docker container): Guide
  3. Stack Overflow 2018 Developer Survey Dataset (Available on Kaggle public datasets).
  4. Import Stack Overflow 2018 Developer Survey Dataset to MongoDB server.

Upon completing the environment setup successfully, you should be able to connect a charts application to your browser on port 80. Log in using username and password created in Step 2.

Image title

Import Dataset to MongoDB

Import Stack Overflow 2018 Developer Survey Dataset to MongoDB server:

 mongoimport --host `hostname` --port 27017 --db stackoverflow_survey --type csv --headerline survey_results_public.csv

Create Data Source in Charts:

Image title

The newly created data source will be listed in charts:

Image title

Create a Dashboard and Start Building Charts

Image title

Chart 1: Developer Demographics by Country

Choose the stackoverflow_survery data source from Data Source. From the Fields section, select Country key and drag the Country to Y-axis encoding channel. This determines which key to aggregate on.

Select _id from Fields section and drag it to the X-axis encoding channel.

Select AGGREGATED_VALUE on the Y-axis menu and sort descending from 9-1.

Apply appropriate filter to filer "NA" values from your result.

Image title

Chart 2: Commonly Used Communication Tools

Image title

Chart 3: Operating System Primarily Used by Developers

Image title

Add All the Charts to the Dashboard

Image title


This was a getting started guide with MongoDB Charts. Explore more powerful features of MongoDB charts and build dashboards for your data using this guide.

data analysis ,data visualization ,mongodb charts tutorial ,big data

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}