Eliot's Weekly Challenge is a competition for developers in the run-up to our annual conference, MongoDB World. Test out your skills and win prizes every week. Find out more here.
In week one, we explored the aggregation framework with a sample data set of meteorite landings. This week, we’re going on the road and challenging you to help us “chart” the best, most interesting locations in the world using MongoDB Charts.
MongoDB Charts is the fastest and easiest way to create visualizations of MongoDB data. Connect to any MongoDB instance as a data source, create charts and graphs, build dashboards, and share them with other users for collaboration. For this week’s challenge, we’re going to challenge you to conjure your inner data analyst and explore some data from a sample AirBNB dataset.
The first twenty correct submissions will receive a $10 Amazon Gift Card and will be entered into a raffle for the main prize. The main prize for week 2 is:
• $2000 Amazon Gift Card
• $500 MongoDB Atlas Credits
• A custom MongoDB shirt, which you’ll be able to retrieve at MongoDB World.
• A Conference Pass to MongoDB World
Shrey! Congratulations Shrey, we will send you an email with all the details about your prize.
And here are the names of all the others who submitted correct answers. We will notify you by email about your $10 Amazon Gift Card!
Yuval, Atish, Bart, Jonathan, Ari, Sheldon, Beatriz, Tajay, Alwin, Tom, Gaurav, Pankil, Saroj,
Shashwat, Piyush, Chris, Agung, Mohamed, and Tobias!
Check out our blog for the solution to this challenge!
We’re planning a trip for all the MongoDB Engineers and we want to make sure that they visit and stay in the most popular destination spots in the world. We’re very particular about the accommodations we arrange for our Engineers. So we’re hoping you’ll help us sort out all of the details we need in order to plan their trip. To do this, you’ll use the sample AirBNB dataset available right inside your MongoDB Atlas cluster.
All of the answers we need to plan our trip can be found in the data set. To aid in the discovery of answers to these questions, MongoDB Charts will illuminate the necessary details. Use the following instructions to get started.
1. Launch a free MongoDB Atlas M0 instance.
MongoDB Atlas is database as a service. With Atlas, you can easily launch, scale and manage your MongoDB data in the cloud.
3. Activate MongoDB Charts in your Atlas project
The link to Charts is on the menu at the left of the Atlas console.
A. Create a Charts Data Source
Use the Data Sources tab to create a new data source for the sample_airbnb.listingsAndReviews
collection.
B. Create a new dashboard. This is where you’ll be creating your charts!
C. Add charts to your dashboard to answer each of the questions below.
4. Embed your charts in a MongoDB Stitch App using Static Hosting.
To show us that you’ve used MongoDB Charts to analyze the AirBNB data to answer these questions, we’ll not only ask you to answer questions about the data, but we’ll ask you to provide a link to the chart you created to answer the question. Embedding is a new feature in MongoDB Charts and lets you create beautiful depictions of your data and embed them into your web pages and applications. Read more about embedding in the documentation.
The questions below will present a scenario which requires analysis. Create a separate chart to answer each of the questions below. To submit your solution for the challenge, you will need to embed each of the charts into a web page and provide the URL to this page as your answer. This page should be internet accessible so that our judges can review your solution.
1. Remember we want our Engineers to stay in the most popular, populated market. To that end, use MongoDB Charts to analyze the data to determine which market (address.market
field) has the largest number of properties listed in the sample dataset. Create a chart showing your analysis and provide a link to this chart using the embed code feature of Charts.
2. MongoDB Engineers typically like to stay in either Tree Houses or Castles. On average, does it cost more to stay in a treehouse or a castle? To solve this, you will probably want to use the mean value of the property_type
and price
fields in you chart.
3. We also like to ensure that our Engineers stay where they have the most amenities. In which market (address.market
field) do properties have the highest average number of amenities (amenities
)?
4. Of the properties with at least one review (number_of_reviews
), what month and year had the highest number of first reviews (first_review
field)?
5. We have a lot of Engineers these days and we want to try to get them all in the same home. Help us out and find out what is the maximum number of bedrooms (bedrooms
field) of any property in the dataset?
6. Please enter the URL to the HTML page you created with the embedded charts that answer the questions above.
Once you have answers to these questions hit the submit button below and fill out the form. If you’re one of the first twenty participants to submit the correct answers, you’ll receive $20 in MongoDB Cash valid for exchange at the MongoDB World Swagstore.
You have until Monday, May 13th, at 5:00pm (Eastern Daylight Time) to submit your answers.
1. Sign up for MongoDB Atlas
Create a free M0 MongoDB Cluster
2. Use the “Load Sample Dataset” option to make the sample data available in your newly deployed cluster.
3. Activate Charts for your cluster.
A. Create a new data source for the sample_AirBNB database, listingsAndReviews collection.
B. Create a new Dashboard
C. Create a new Chart (for each question above)
- Select the data source you created to expose the fields from the dataset.
- Drag the fields from the field listing to the X, and Y Axis to visualize the data using different chart types.
D. Once you’ve analyzed the fields necessary to solve the questions above, save and close the chart.
E. Enable unauthenticated access to the charts so that you’re able to create Embed Code to share your charts.
4. Create a Stitch App
A. Enable Static Hosting.
B. Create a new HTML page using your favorite text editor and upload that page to your new static hosting area.
C. Navigate in your browser to your newly created HTML page to verify that the chart displays properly. Note the URL - and use this as the answer to the questions above in question #6.
Q: Why can’t I see sample_AirBNB in my list of data sources in Charts?
A: It’s possible that you didn’t create the datasource properly. Go back to the main Charts dashboard and click the Data Sources tab. Click “New Data Source”, select your cluster, and find the sample_AirBNB dataset.
Q: Where do I find the URL for the chart I created?
A: MongoDB Charts supports Embedding - this feature enables you to embed charts you create into other web pages and applications. Refer to the documentation for additional information and to learn how to enable embedding to retrieve the code necessary to embed in a web page.
Note that Static Hosting is a BETA feature within MongoDB Stitch. Refer to the documentation for specifics and review the tutorial video above.
Q: Do I need to pay for a MongoDB Atlas cluster?
A: No. The challenge does not require an instance that is larger than the M0 Sandbox cluster. MongoDB Atlas Free Tier instances are free forever. Be sure you follow the tutorial video if you need assistance in deploying a free tier instance.
Q: How, or where do I host the HTML page I created with the embedded charts?
A: Use MongoDB Stitch Static hosting.
Eliot's Weekly MongoDB World Challenge is a competition for developers in the run up to MongoDB's global conference. You can win up to $6,000!