In this chapter, we will cover the following recipes:
Creating test data
Performing simple querying, projections, and pagination from the Mongo shell
Updating and deleting data from the shell
Creating an index and viewing plans of queries
Background and foreground index creation from the shell
Creating unique indexes on collection and deleting the existing duplicate data automatically
Creating and understanding sparse indexes
Expiring documents after a fixed interval using the TTL index
Expiring documents at a given time using the TTL index