![]()
MongoDB Cookbook Second Edition
Table of Contents
MongoDB Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Installing and Starting the Server
Introduction
Installing single node MongoDB
Getting ready
How to do itā¦
How it worksā¦
See also
Starting a single node instance using command-line options
Getting ready
How to do itā¦
How it worksā¦
There's moreā¦
See also
Single node installation of MongoDB with options from the config file
Getting ready
How to do itā¦
How it worksā¦
Connecting to a single node in the Mongo shell with JavaScript
Getting ready
How to do itā¦
How it worksā¦
Connecting to a single node using a Java client
Getting ready
How to do itā¦
How it worksā¦
Connecting to a single node using a Python client
Getting ready
How to do itā¦
How it worksā¦
Starting multiple instances as part of a replica set
Getting ready
How to do itā¦
How it worksā¦
There's moreā¦
See also
Connecting to the replica set in the shell to query and insert data
Getting ready
How to do itā¦
How it worksā¦
See also
Connecting to the replica set to query and insert data from a Java client
Getting ready
How to do itā¦
How it worksā¦
Connecting to the replica set to query and insert data using a Python client
Getting ready
How to do itā¦
How it worksā¦
Starting a simple sharded environment of two shards
Getting ready
How to do itā¦
How it worksā¦
There's moreā¦
Connecting to a shard in the shell and performing operations
Getting ready
How to do itā¦
How it worksā¦
There's moreā¦
2. Command-line Operations and Indexes
Introduction
Creating test data
Getting ready
How to do itā¦
How it worksā¦
See also
Performing simple querying, projections, and pagination from Mongo shell
Getting ready
How to do itā¦
How it worksā¦
Updating and deleting data from the shell
Getting ready
How to do itā¦
How it worksā¦
Creating index and viewing plans of queries
Getting ready
How to do itā¦
How it worksā¦
Analyzing the plan
Improving the query execution time
Improvement using indexes
Improvement using covered indexes
Some caveats of index creations
Creating a background and foreground index in the shell
Getting ready
How to do itā¦
How it worksā¦
Creating and understanding sparse indexes
Getting ready
How to do itā¦
How it worksā¦
Expiring documents after a fixed interval using the TTL index
Getting ready
How to do itā¦
How it worksā¦
See also
Expiring documents at a given time using the TTL index
Getting ready
How to do itā¦
How it worksā¦
See also
3. Programming Language Drivers
Introduction
Executing query and insert operations with PyMongo
Getting ready
How to do itā¦
How it worksā¦
See also
Executing update and delete operations using PyMongo
Getting ready
How to do itā¦
How it worksā¦
Implementing aggregation in Mongo using PyMongo
Getting ready
How to do itā¦
How it worksā¦
Executing MapReduce in Mongo using PyMongo
Getting ready
How to do itā¦
How it worksā¦
See also
Executing query and insert operations using a Java client
Getting ready
How to do itā¦
How it worksā¦
See alsoā¦
Executing update and delete operations using a Java client
Getting ready
How to do itā¦
How it worksā¦
See also
Implementing aggregation in Mongo using a Java client
Getting ready
How to do itā¦
How it worksā¦
Executing MapReduce in Mongo using a Java client
Getting ready
How to do itā¦
How it worksā¦
See also
4. Administration
Introduction
Renaming a collection
Getting ready
How to do itā¦
How it worksā¦
Viewing collection stats
Getting ready
How to do itā¦
How it worksā¦
See also
Viewing database stats
Getting ready
How to do itā¦
How it worksā¦
How it worksā¦
Manually padding a document
Getting ready
How to do itā¦
How it worksā¦
The mongostat and mongotop utilities
Getting ready
How to do itā¦
How it worksā¦
See also
Getting current executing operations and killing them
Getting ready
How to do itā¦
How it worksā¦
Using profiler to profile operations
Getting ready
How to do itā¦
How it worksā¦
Setting up users in Mongo
Getting ready
How to do itā¦
How it worksā¦
There's moreā¦
See also
Interprocess security in Mongo
Getting ready
How to do itā¦
There's moreā¦
Modifying collection behavior using the collMod command
Getting ready
How it worksā¦
How it worksā¦
Setting up MongoDB as a windows service
Getting ready
How to do itā¦
Replica set configurations
Getting ready
Elections in a replica set
Basic configuration for a replica set
How to do itā¦
How it worksā¦
Replica set member as an arbiter
Priority of replica set members
Hidden, slave delayed, and build index configuration
There's moreā¦
Stepping down as primary from the replica set
Getting ready
How to do itā¦
How it worksā¦
Exploring the local database of a replica set
Getting ready
How to do itā¦
How it worksā¦
There's moreā¦
Understanding and analyzing oplogs
Getting ready
How to do itā¦
How it worksā¦
Building tagged replica sets
Getting ready
How to do itā¦
How it worksā¦
WriteConcern in tagged replica sets
ReadPreference in tagged replica sets
Configuring the default shard for non-sharded collections
Getting ready
How to do itā¦
How it worksā¦
Manual split and migration of chunks
Getting ready
How to do itā¦
How it worksā¦
Domain-driven sharding using tags
Getting ready
How to do itā¦
How it worksā¦
Exploring the config database in a sharded setup
Getting ready
How to do itā¦
How it worksā¦
5. Advanced Operations
Introduction
Atomic find and modify operations
Getting ready
How to do itā¦
How it worksā¦
See also
Implementing atomic counters in Mongo
Getting ready
How to do itā¦
How it worksā¦
See also
Implementing server-side scripts
Getting ready
How to do itā¦
How it worksā¦
Creating and tailing a capped col...