MongoDB 301 Mid-Course Feedback
Lesson 3, Exercise 4: Changing the field order in the aggregation pipeline Posted on: 14/09/2020 (last updated: 24/01/2023) by Kathryn Vargas
In this exercise, you will add the fourth stage to the pipeline. The stage is based on the $replaceRoot aggregate operator, which replaces input documents with output documents. In this way, you can reorder the fields as they appear in the pipeline. To change the field order in the aggregation pipeline 1. On the Pipeline […]
Lesson 6, Exercise 1: Importing document data from a .csv file Posted on: 09/10/2019 (last updated: 24/01/2023) by Kathryn Vargas
In this exercise, you’ll create the pubs database and then import the document data in the british_pubs.csv file to the british_pubs collection. You’ll then review the collection to verify that the document data has been properly imported into Studio 3T. To import the documents 1. Launch Studio 3T and connect to MongoDB Atlas. 2. In the Connection Tree, right-click […]
Exercise 1: Adding lookup data to the aggregation pipeline Posted on: 16/02/2022 (last updated: 24/01/2023) by Dj Walker-Morgan
In this exercise, you’ll import the states_transactions.js file into the Aggregation Editor. The file contains the aggregate statement that you updated in the second section of this course. You’ll use this statement as the foundation for all four exercises in this section, modifying the statement as you work through them. In this exercise, you’ll add […]
Lesson 3, Exercise 5: Sorting the documents in the aggregation pipeline Posted on: 14/09/2020 (last updated: 24/01/2023) by Kathryn Vargas
In this exercise, you will add the fifth and last stage to the pipeline. The stage is based on the $sort aggregate operator, which lets you sort the documents in the pipeline, based on one or more fields. To sort the documents in the aggregation pipeline 1. On the Pipeline tab of the Aggregation Editor, […]
Lesson 6, Exercise 2: Exporting document data to a .json file Posted on: 09/10/2019 (last updated: 24/01/2023) by Kathryn Vargas
In this exercise, you’ll create a simple query that limits the pubs in the british_pubs collection to those located in Scotland. You’ll then export the query results to a .json file. To export the documents 1. On the british_pubs collection tab, select the Table View option. 2. Double-click any value in the address field. The Result tab now displays the fields in the […]
Exercise 2: Converting string values in one of the lookup fields to integers Posted on: 16/02/2022 (last updated: 24/01/2023) by Dj Walker-Morgan
In this exercise, you’ll add a stage to the aggregation pipeline after the $replaceRoot stage. The new stage will convert the data in the population field from string values to integers. As part of this process, you’ll first remove the commas from the string values so you do not receive an error when trying to […]
Lesson 4, Exercise 1: Using IntelliShell to query single and multiple values in an array Posted on: 15/09/2020 (last updated: 24/01/2023) by Kathryn Vargas
In this exercise, you’ll use IntelliShell to create and run several queries that retrieve data from the customers collection. The queries will be based on values in the interests array. To build the queries in IntelliShell 1. Launch Studio 3T and connect to MongoDB Atlas. 2. In the Connection Tree, right-click the sales database node […]
Lesson 6, Exercise 3: Exporting document data to a new collection Posted on: 09/10/2019 (last updated: 24/01/2023) by Kathryn Vargas
In this exercise, you’ll create the scottish_info database and then add the scottish_pubs collection to the database. Next, you’ll export the query results you generated in Exercise 2 to the new collection. To export the documents 1. In the Connection Tree, right-click the connection (top-level node) and click Add Database. 2. In the Add Database dialog box, type scottish_info in the Database Name text box, and then click OK. Studio […]
Exercise 3: Adding a computed ratio field based on the converted lookup field Posted on: 16/02/2022 (last updated: 24/01/2023) by Dj Walker-Morgan
In this exercise, you’ll add a stage to the aggregation pipeline after the $set stage. The new stage will insert a field into the pipeline that provides the transactions-to-population ratio for each state. You’ll also round the ratio values to seven decimal places. To add the ratio field On the Pipeline tab of the Aggregation […]
Tags
Browse by MongoDB topic
- Connecting to MongoDB
- Database Administration & Security
- Getting Started with MongoDB
- Getting Started with Studio 3T
- Import/Export
- Job Automation & Scheduling
- MongoDB Aggregation Framework
- MongoDB/Studio 3T Workshops
- Performance
- Query & CRUD Operations
- Reference
- Schema
- Studio 3T Licensing
- Support and other resources
- Working with MongoDB & SQL
- Working with MongoDB Atlas