You are previewing MongoDB Basics.
O'Reilly logo
MongoDB Basics

Book Description

Need a quick and easy to understand introduction to MongoDB and NoSQL databases? MongoDB Basics, from The Definitive Guide to MongoDB, 2E, shows you how a document-oriented database system differs from a relational database, and how to install and get started using it. You'll also learn MongoDB design basics, including geospatial indexing, how to navigate, view, and query your database, and how to use GridFS with a bit of Python.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Authors
  8. About the Technical Reviewers
  9. Acknowledgments
  10. Introduction
  11. Chapter 1: Introduction to MongoDB
    1. Reviewing the MongoDB Philosophy
      1. Using the Right Tool for the Right Job
      2. Lacking Innate Support for Transactions
      3. JSON and MongoDB
      4. Adopting a Nonrelational Approach
      5. Opting for Performance vs. Features
      6. Running the Database Anywhere
    2. Fitting Everything Together
      1. Generating or Creating a Key
      2. Using Keys and Values
      3. Implementing Collections
      4. Understanding Databases
    3. Reviewing the Feature List
      1. Using Document-Oriented Storage (BSON)
      2. Supporting Dynamic Queries
      3. Indexing Your Documents
      4. Leveraging Geospatial Indexes
      5. Profiling Queries
      6. Updating Information In-Place
      7. Storing Binary Data
      8. Replicating Data
      9. Implementing Sharding
      10. Using Map and Reduce Functions
      11. The MongoDB Aggregation Framework
    4. Getting Help
      1. Visiting the Website
      2. Chatting with the MongoDB Developers
      3. Cutting and Pasting MongoDB Code
      4. Finding Solutions on Google Groups
      5. Leveraging the JIRA Tracking System
    5. Summary
  12. Chapter 2: Installing MongoDB
    1. Choosing Your Version
      1. Understanding the Version Numbers
    2. Installing MongoDB on Your System
      1. Installing MongoDB under Linux
      2. Installing MongoDB under Windows
    3. Running MongoDB
      1. Prerequisites
      2. Surveying the Installation Layout
      3. Using the MongoDB Shell
    4. Installing Additional Drivers
      1. Installing the PHP Driver
      2. Confirming That Your PHP Installation Works
      3. Installing the Python Driver
      4. Confirming That Your PyMongo Installation Works
    5. Summary
  13. Chapter 3: The Data Model
    1. Designing the Database
      1. Drilling Down on Collections
      2. Using Documents
      3. Creating the _id Field
    2. Building Indexes
      1. Impacting Performance with Indexes
    3. Implementing Geospatial Indexing
      1. Querying Geospatial Information
    4. Using MongoDB in the Real World
    5. Summary
  14. Chapter 4: Working with Data
    1. Navigating Your Databases
      1. Viewing Available Databases and Collections
    2. Inserting Data into Collections
    3. Querying for Data
      1. Using the Dot Notation
      2. Using the Sort, Limit, and Skip Functions
      3. Working with Capped Collections, Natural Order, and $natural
      4. Retrieving a Single Document
      5. Using the Aggregation Commands
      6. Working with Conditional Operators
      7. Leveraging Regular Expressions
    4. Updating Data
      1. Updating with update()
      2. Implementing an Upsert with the save( ) Command
      3. Updating Information Automatically
      4. Specifying the Position of a Matched Array
      5. Atomic Operations
      6. Modifying and Returning a Document Atomically
    5. Renaming a Collection
    6. Removing Data
    7. Referencing a Database
      1. Referencing Data Manually
      2. Referencing Data with DBRef
    8. Implementing Index-Related Functions
      1. Surveying Index-Related Commands
      2. Forcing a Specified Index to Query Data
      3. Constraining Query Matches
    9. Summary
  15. Chapter 5: GridFS
    1. Filling in Some Background
    2. Working with GridFS
    3. Getting Started with the Command-Line Tools
      1. Using the _id Key
      2. Working with Filenames
      3. Determining a File’s Length
      4. Working with Chunk Sizes
      5. Tracking the Upload Date
      6. Hashing Your Files
    4. Looking Under MongoDB’s Hood
      1. Using the search Command
      2. Deleting
      3. Retrieving Files from MongoDB
      4. Summing Up mongofiles
    5. Exploiting the Power of Python
      1. Connecting to the Database
      2. Accessing the Words
    6. Putting Files into MongoDB
    7. Retrieving Files from GridFS
    8. Deleting Files
    9. Summary
  16. Index