liveBook · Manning

What you will learn in MongoDB 8.0 in Action, Third Edition

Building on the Atlas Data Platform

by Arek Borucki

Chapter by chapter

Chapter 1: Understanding the world of MongoDB

1.1 Examining the document-oriented data model · 1.2 Scaling data horizontally · 1.3 Exploring the MongoDB ecosystem · 1.3.1 Learning the core MongoDB server features · 1.3.2 Learning MongoDB Atlas concepts · 1.4 Enhancing the TCMalloc version · 1.5 Discovering MongoDB Query API · 1.6 Summary

What you learn in chapter 1 →

Chapter 2: Getting started with Atlas and MongoDB data

2.1 Setting up your first Atlas cluster using Atlas CLI · 2.1.1 Installing the Atlas CLI · 2.1.2 Creating an Atlas account · 2.1.3 Creating an organization · 2.1.4 Creating an Atlas project · 2.1.5 Creating a MongoDB Atlas cluster · 2.1.6 Navigating the Atlas user interface · 2.2 Loading a sample data set · 2.3 Adding an IP address to the project access list · 2.4 Creating a user · 2.5 Establishing a connection to MongoDB through MongoDB Shell · 2.6 Managing data with databases, collections, and documents · 2.6.1 Working with dynamic schema · 2.6.2 Working with databases · 2.6.3 Working with collections · 2.6.4 Working with documents · 2.7 Summary

What you learn in chapter 2 →

Chapter 3: Communicating with MongoDB

3.1 Interacting via MongoDB Wire Protocol · 3.2 Discovering mongosh · 3.2.1 Connecting to MongoDB Atlas · 3.2.2 Connecting to self-hosted deployments · 3.2.3 Performing operations · 3.2.4 Viewing mongosh logs · 3.2.5 Running scripts in mongosh · 3.2.6 Configuring mongosh · 3.2.7 Using .mongoshrc.js · 3.3 Playing with MongoDB Compass · 3.4 Connecting using MongoDB drivers · 3.5 Using the Node.js driver · 3.6 Employing Python drivers · 3.6.1 PyMongo · 3.6.2 Motor · 3.6.3 PyMongo vs. Motor · 3.7 Integrating Ruby drivers · 3.8 Learning Mongoid · 3.9 Summary

What you learn in chapter 3 →

Chapter 4: Executing CRUD operations

4.1 Connecting to mongosh for CRUD operations · 4.2 Inserting documents · 4.3 Updating documents · 4.3.1 Using update operators · 4.3.2 Updating many documents · 4.4 Updating arrays · 4.4.1 Adding elements to an array · 4.4.2 Removing elements from an array · 4.4.3 Updating array elements · 4.4.4 Updating using array filters · 4.5 Replacing documents · 4.6 Reading documents · 4.6.1 Using logical operators · 4.6.2 Using comparison operators · 4.6.3 Working with projections · 4.6.4 Searching for null values and absent fields · 4.7 Performing regular-expression searches · 4.8 Querying arrays · 4.9 Querying embedded/nested documents · 4.9.1 Querying on a nested field with dot notation · 4.9.2 Matching an embedded/nested document · 4.9.3 Querying an array of embedded documents · 4.10 Sorting, skipping, and limiting · 4.10.1 The sort operation · 4.10.2 The skip operation · 4.10.3 The limit operation · 4.11 Deleting documents · 4.12 Using bulkWrite() · 4.13 Understanding cursors · 4.13.1 Using manual iteration · 4.13.2 Returning an array of all documents · 4.14 Employing MongoDB Stable API · 4.15 Summary

What you learn in chapter 4 →

Chapter 5: Designing a MongoDB schema

5.1 Organizing the MongoDB data model · 5.1.1 Determining the workload of the application · 5.1.2 Mapping the schema relationship · 5.1.3 Applying a design pattern · 5.2 Embedding vs. referencing · 5.3 Understanding schema design patterns · 5.3.1 Approximation pattern · 5.3.2 Archive pattern · 5.3.3 Attribute pattern · 5.3.4 Bucket pattern · 5.3.5 Computed pattern · 5.3.6 Document Versioning pattern · 5.3.7 Extended Reference pattern · 5.3.8 Outlier pattern · 5.3.9 Polymorphic pattern · 5.3.10 Preallocation pattern · 5.3.11 Schema Versioning pattern · 5.3.12 Subset pattern · 5.3.13 Tree pattern · 5.4 Schema validations · 5.4.1 Specifying JSON schema validation · 5.4.2 Testing a schema validation rule · 5.4.3 Modifying schema validator behavior · 5.4.4 Bypassing schema validation · 5.5 MongoDB schema antipatterns · 5.6 Summary

What you learn in chapter 5 →

Chapter 6: Building aggregation pipelines

6.1 Understanding the aggregation framework · 6.1.1 Writing an aggregation pipeline · 6.1.2 Viewing the aggregation pipeline stages · 6.1.3 Using $set and $unset instead of $project · 6.1.4 Scenarios for $set and $unset operators · 6.1.5 Scenario for the $project operator · 6.1.6 Saving the results of aggregation pipelines · 6.2 Joining collections · 6.2.1 Creating a MongoDB view using $lookup · 6.2.2 Using $lookup with $mergeobjects · 6.3 Deconstructing arrays with $unwind · 6.4 Working with accumulators · 6.5 Using the MongoDB Atlas aggregation pipeline builder · 6.6 Summary

What you learn in chapter 6 →

Chapter 7: Indexing for query performance

7.1 MongoDB query planner · 7.1.1 Viewing query plan cache information · 7.1.2 MongoDB plan cache purges · 7.2 Supported index types · 7.2.1 Creating single field indexes · 7.2.2 Understanding compound indexes · 7.2.3 Using multikey indexes · 7.2.4 Using text indexes · 7.2.5 Creating wildcard indexes · 7.2.6 Geospatial indexes · 7.2.7 Hashed indexes · 7.3 Dropping indexes · 7.4 MongoDB index attributes · 7.4.1 Partial indexes · 7.4.2 Sparse indexes · 7.4.3 Time-to-live indexes · 7.4.4 Hidden indexes · 7.5 Understanding index builds · 7.5.1 Monitoring in-progress index builds · 7.5.2 Terminating in-progress index builds · 7.6 Managing indexes · 7.6.1 Discovering the $indexStats aggregation pipeline stage · 7.6.2 Modifying indexes · 7.6.3 Controlling index use with hint () · 7.6.4 Using indexes with $OR queries · 7.6.5 Using indexes with the $NE, $NIN, and $NOT operators · 7.6.6 Ensuring that indexes fit in RAM · 7.6.7 Sorting on multiple fields · 7.6.8 Introducing covered queries · 7.7 When to not use an index · 7.8 Summary

What you learn in chapter 7 →

Chapter 8: Executing multidocument ACID transactions

8.1 WiredTiger storage engine · 8.1.1 Snapshots and checkpoints · 8.1.2 Journaling · 8.1.3 Compression · 8.1.4 Memory use · 8.2 Single-document transaction · 8.3 Defining ACID · 8.4 Multidocument transactions · 8.4.1 Differentiating the Core and Callback APIs · 8.4.2 Using transactions with mongosh · 8.4.3 Using transactions with the Callback API · 8.5 MongoDB transaction considerations · 8.6 Summary

What you learn in chapter 8 →

Chapter 9: Using replication and sharding

9.1 Ensuring data high availability with replication · 9.1.1 Distinguishing replica set members · 9.1.2 Electing primary replica-set member · 9.1.3 Understanding the oplog collection · 9.2 Understanding change streams · 9.2.1 Connections for a change stream · 9.2.2 Changing streams with Node.js · 9.2.3 Modifying the output of a change stream · 9.3 Scaling data horizontally through sharding · 9.3.1 Viewing sharded cluster architecture · 9.3.2 Creating sharded clusters via Atlas CLI · 9.3.3 Working with a shard key · 9.3.4 Choosing a shard key · 9.3.5 Using a shard-key analyzer · 9.3.6 Detecting shard-data imbalance or uneven data distribution · 9.3.7 Resharding a collection · 9.3.8 Understanding chunk balancing · 9.3.9 Administrating chunks · 9.3.10 Automerging chunks · 9.4 MongoDB 8.0 sharded cluster features · 9.4.1 Embedding config servers in sharded clusters · 9.4.2 Moving unsharded collections seamlessly between shards · 9.4.3 Fragmentation · 9.4.4 Faster resharding · 9.4.5 Unsharding collections · 9.5 Managing data consistency and availability · 9.5.1 Write Concern · 9.5.2 Read Concern · 9.5.3 Read Preference · 9.6 Summary

What you learn in chapter 9 →

Chapter 10: Delving into Database as a Service

10.1 Shared M0 and Flex clusters · 10.2 Dedicated clusters · 10.2.1 Atlas clusters for low-traffic applications · 10.2.2 Atlas clusters for high-traffic applications · 10.2.3 Autoscaling clusters and storage · 10.2.4 Customizing Atlas cluster storage · 10.3 Atlas Global Clusters · 10.4 Going multiregion with workload isolation · 10.4.1 Adding electable nodes for high availability · 10.4.2 Adding read-only nodes for local reads · 10.4.3 Using analytics nodes for workload isolation · 10.5 Using predefined replica set tags for querying · 10.5.1 Routing queries to analytics nodes · 10.5.2 Isolating normal application secondary reads from analytics nodes · 10.5.3 Routing local reads for geographically distributed applications · 10.6 Understanding the Atlas custom Write Concerns · 10.7 Summary

What you learn in chapter 10 →

Chapter 11: Carrying out full-text search using Atlas Search

11.1 Implementing full-text search · 11.2 Understanding Apache Lucene · 11.3 Getting to know Atlas Search · 11.3.1 Learning Atlas Search architecture · 11.3.2 Using Atlas Search Nodes · 11.3.3 Atlas Search indexes · 11.4 Building an Atlas Search index · 11.5 Running Atlas Search queries · 11.5.1 Using the $search aggregation pipeline stage · 11.5.2 Executing the $searchMeta aggregation pipeline stage · 11.6 Learning Atlas Search commands · 11.7 Using Atlas Search Playground · 11.8 Summary

What you learn in chapter 11 →

Chapter 12: Learning semantic techniques and Atlas Vector Search

12.1 Starting with embeddings · 12.1.1 Converting text to embeddings · 12.1.2 Understanding vector databases · 12.2 Using embeddings with Atlas Vector Search · 12.2.1 Building an Atlas Vector Search index · 12.2.2 Selecting a Vector Search source · 12.2.3 Defining your Vector Search index · 12.2.4 Creating an Atlas Vector Search index · 12.3 Running Atlas Vector Search queries · 12.3.1 Querying with embeddings · 12.3.2 Using prefiltering with Atlas Vector Search · 12.4 Executing vector search with programming languages · 12.4.1 Using vector search with JavaScript · 12.4.2 Using vector search and prefiltering with Python · 12.4.3 Using vector search with prefilters in Ruby · 12.5 Using Atlas Triggers for automated embeddings creation · 12.6 Workload isolation with vector search dedicated nodes · 12.7 Improving Atlas Vector Search performance · 12.8 Summary

What you learn in chapter 12 →

Chapter 13: Developing AI applications locally with the Atlas CLI

13.1 Introducing local Atlas clusters · 13.2 Creating an Atlas cluster locally with Atlas CLI · 13.2.1 Configuring Docker · 13.2.2 Building your first local Atlas cluster · 13.3 Managing your local Atlas cluster · 13.3.1 Stopping, starting, checking, and deleting your local cluster · 13.3.2 Loading a sample data set · 13.4 Diving into a local Atlas cluster · 13.4.1 Displaying processes · 13.4.2 Executing into the container · 13.5 Creating search indexes · 13.5.1 Executing full-text search locally · 13.5.2 Executing vector search locally · 13.6 Summary

What you learn in chapter 13 →

Chapter 14: Building retrieval-augmented generation AI chatbots

14.1 Gaining insight into retrieval-augmented generation · 14.2 Embedding LangChain in the RAG ecosystem · 14.3 Introducing the MongoDB Atlas Vector Search RAG template · 14.4 Getting started with AI chatbots · 14.4.1 Describing LangChain capabilities · 14.4.2 Starting with the LangChain CLI · 14.5 Creating an AI-powered MongoDB chatbot · 14.5.1 Setting up a new application · 14.5.2 Inserting embeddings into MongoDB Atlas · 14.5.3 Creating an Atlas Vector Search index · 14.5.4 Testing a chatbot with LangServe · 14.5.5 Communicating programmatically with a chatbot · 14.6 Summary

What you learn in chapter 14 →

Chapter 15: Building event-driven applications

15.1 Understanding event-driven technology · 15.2 Examining the concepts of stream processing · 15.2.1 Differentiating event time and processing time · 15.2.2 Using time windows · 15.3 Starting with Atlas Stream Processing · 15.4 Exploring Atlas Stream Processing · 15.4.1 Discovering Atlas Stream Processing components · 15.4.2 Understanding Atlas Stream Processing capabilities · 15.5 Structuring a stream processor aggregation pipeline · 15.5.1 Taking a deep dive into the $source aggregation stage · 15.5.2 Using the stream processor $validate aggregation stage · 15.5.3 Viewing all supported aggregation pipeline stages · 15.6 Mastering Atlas Stream Processing · 15.6.1 Adopting new stream processor methods · 15.6.2 Using the Atlas CLI with stream processing · 15.6.3 Creating your first stream processor · 15.6.4 Learning the anatomy of a stream processor · 15.6.5 Setting up a streams Connection Registry · 15.6.6 Ensuring persistence in stream processing · 15.7 Controlling the stream processing flow · 15.7.1 Capturing the state · 15.7.2 Using a dead-letter queue · 15.8 Securing Atlas Stream Processing · 15.8.1 Discovering new roles · 15.8.2 Learning new privilege actions · 15.8.3 Protecting network access · 15.8.4 Auditing events · 15.9 Summary

What you learn in chapter 15 →

Chapter 16: Optimizing data processing with Atlas Data Federation

16.1 Querying Amazon S3 and Azure Blob Store data via the Query API · 16.2 Learning Atlas Data Federation architecture · 16.3 Deploying an Atlas Federated Database instance · 16.4 Limitations of Atlas Data Federation · 16.5 Charges for Atlas Data Federation · 16.6 Summary

What you learn in chapter 16 →

Chapter 17: Archiving online with Atlas Online Archive

17.1 Archiving your data · 17.1.1 Seeing how Atlas archives data · 17.1.2 Deleting archived documents · 17.2 Initializing Online Archive · 17.3 Connecting and querying Online Archive · 17.4 Restoring archived data · 17.5 Summary

What you learn in chapter 17 →

Chapter 18: Querying Atlas using SQL

18.1 Introducing the Atlas SQL interface · 18.2 Connecting to the Atlas SQL interface · 18.2.1 Enabling the interface · 18.2.2 Accessing the interface · 18.3 Querying MongoDB using SQL · 18.3.1 Aggregation pipeline Atlas SQL syntax · 18.3.2 Short-form Atlas SQL syntax · 18.3.3 UNWIND and FLATTEN with Atlas SQL · 18.4 Summary

What you learn in chapter 18 →

Chapter 19: Creating charts, database triggers, and functions

19.1 Visualizing data with Atlas Charts · 19.1.1 Using natural language to build visualizations · 19.1.2 Using billing dashboards · 19.2 Atlas Application Services · 19.2.1 Triggering server-side logic with Atlas Database Triggers · 19.2.2 Writing Atlas Functions · 19.3 Summary

What you learn in chapter 19 →

Chapter 20: Understanding Atlas and MongoDB security features

20.1 Understanding the shared responsibility model · 20.2 Managing authentication · 20.2.1 Choosing an Atlas database cluster authentication method · 20.2.2 Integrating with HashiCorp Vault · 20.2.3 Choosing the authentication method · 20.3 Handling authorization · 20.3.1 Understanding the principle of least privilege · 20.3.2 Differentiating Atlas user roles · 20.3.3 Using MongoDB RBAC · 20.4 Auditing Atlas · 20.5 Encrypting data in Atlas · 20.5.1 Encrypting data in transit · 20.5.2 Encrypting data at rest · 20.5.3 Managing encryption keys yourself · 20.5.4 Encrypting during processing · 20.6 Securing the network · 20.6.1 Using an IP access list · 20.6.2 Peering networks · 20.6.3 Using private endpoints · 20.7 Implementing defense in depth · 20.8 Summary

What you learn in chapter 20 →

Chapter 21: Operational excellence with Atlas

21.1 Crafting backup strategies and practices · 21.1.1 Discovering Atlas backup methods · 21.1.2 Restoring an Atlas cluster · 21.2 Inspecting the performance of your Atlas cluster · 21.2.1 Finding slow queries · 21.2.2 Improving your schema · 21.2.3 Using native MongoDB diagnostic commands · 21.3 Alerting and logging · 21.3.1 Setting alert conditions · 21.3.2 Logging in Atlas · 21.4 Upgrading your Atlas cluster · 21.5 Summary

What you learn in chapter 21 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.