Practical MongoDB Aggregations The Official Guide to Developing Optimal Aggregation Pipelines with MongoDB 7. 0
Begin your journey toward efficient data manipulation with this robust technical guide and enhance your aggregation skills while building efficient pipelines for a variety of tasks Key Features Build effective aggregation pipelines for increased productivity and performance Solve common data manipul...
Otros Autores: | , |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England :
Packt Publishing
[2023]
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009766138906719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Contributors
- Acknowledgements
- Foreword
- Table of Contents
- Preface
- Chapter 1: MongoDB Aggregations Explained
- What is the MongoDB aggregation framework?
- What is the MongoDB aggregation language?
- What do developers use the aggregation framework for?
- A short history of MongoDB aggregations
- Aggregation capabilities in MongoDB server releases
- Getting going
- Setting up your environment
- Database
- Client tool
- Getting further help
- Summary
- Part 1: Guiding Tips and Principles
- Chapter 2: Optimizing Pipelines for Productivity
- Embrace composability for increased productivity
- Guiding principles to promote composability
- Using macro functions
- So, what's the best way of factoring out code?
- Better alternatives for a projection stage
- When to use set and unset
- When to use project
- The hidden danger of project
- Key projection takeaways
- Summary
- Chapter 3: Optimizing Pipelines for Performance
- Using explain plans to identify performance bottlenecks
- Viewing an explain plan
- Understanding the explain plan
- Guidance for optimizing pipeline performance
- Be cognizant of streaming vs blocking stages ordering
- Avoid unwinding and regrouping documents just to process each array's elements
- Encourage match filters to appear early in the pipeline
- Summary
- Chapter 4: Harnessing the Power of Expressions
- Aggregation expressions explained
- What do expressions produce?
- Chaining operator expressions together
- Can all stages use expressions?
- What is using expr inside match all about?
- Restrictions when using expressions within match
- Advanced use of expressions for array processing
- if-else conditional comparison
- The power array operators
- for-each looping to transform an array.
- for-each looping to compute a summary value from an array
- for-each looping to locate an array element
- Reproducing map behavior using reduce
- Adding new fields to existing objects in an array
- Rudimentary schema reflection using arrays
- Summary
- Chapter 5: Optimizing Pipelines for Sharded Clusters
- A brief summary of MongoDB sharded clusters
- Sharding implications for pipelines
- Sharded aggregation constraints
- Where does a sharded aggregation run?
- Pipeline splitting at runtime
- Execution of the split pipeline shards
- Execution of the merger part of the split pipeline
- Difference in merging behavior for grouping versus sorting
- Performance tips for sharded aggregations
- Summary
- Part 2: Aggregations by Example
- Chapter 6: Foundational Examples: Filtering, Grouping, and Unwinding
- Filtered top subset
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline results
- Pipeline observations
- Group and total
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Unpack arrays and group differently
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline results
- Pipeline observations
- Distinct list of values
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Summary
- Chapter 7: Joining Data Examples
- One-to-one join
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations.
- Multi-field join and one-to-many
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Summary
- Chapter 8: Fixing and Generating Data Examples
- Strongly typed conversion
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Converting incomplete date strings
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Generating mock test data
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Summary
- Chapter 9: Trend Analysis Examples
- Faceted classification
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Largest graph network
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Incremental analytics
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Summary
- Chapter 10: Securing Data Examples
- Redacted view
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Mask sensitive fields
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline.
- Expected pipeline result
- Pipeline observations
- Role programmatic restricted view
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Summary
- Chapter 11: Time-Series Examples
- IoT power consumption
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- State change boundaries
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Summary
- Chapter 12: Array Manipulation Examples
- Summarizing arrays for first, last, minimum, maximum, and average values
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Pivoting array items by a key
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Array sorting and percentiles
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Array element grouping
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Array fields joining
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Comparison of two arrays
- Scenario
- Populating the sample data.
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Jagged array condensing
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Summary
- Chapter 13: Full-Text Search Examples
- What is Atlas Search?
- Compound text search criteria
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Facets and counts text search
- Scenario
- Populating the sample data
- Defining the aggregation pipeline
- Executing the aggregation pipeline
- Expected pipeline result
- Pipeline observations
- Summary
- Appendix
- Afterword
- Index
- Other books you may enjoy.