MongoDB/mongodb-docs-embedded huggingface dataset:
Specialized Data Formats
# Specialized Data Formats

## Overview

You can use several types of specialized data formats in your PyMongo application. To learn how to work with these data formats, see the following sections:

- Learn how to encode and decode custom types in the Custom Types guide.

- Learn how to work with Python `datetime` objects in PyMongo in the Dates and Times guide.

- Learn about UUIDs and how to maintain cross-language compatibility while working with them in the Universally Unique IDs (UUIDs) guide.
Create a MongoDB Deployment
# Create a MongoDB Deployment

You can create a free tier MongoDB deployment on MongoDB Atlas to store and manage your data. MongoDB Atlas hosts and manages your MongoDB database in the cloud.

## Create a Free MongoDB deployment on Atlas

Complete the Get Started with Atlas guide to set up a new Atlas account and load sample data into a new free tier MongoDB deployment.

## Save your Credentials

After you create your database user, save that user's username and password to a safe location for use in an upcoming step.

After you complete these steps, you have a new free tier MongoDB deployment on Atlas, database user credentials, and sample data loaded in your database.

If you run into issues on this step, ask for help in the MongoDB Community Forums or submit feedback by using the Rate this page tab on the right or bottom right side of this page.
Compound Indexes
# Compound Indexes

## Overview

Compound indexes hold references to multiple fields within a collection's documents, improving query and sort performance.

### Sample Data

The examples in this guide use the `sample_mflix.movies` collection from the Atlas sample datasets. To learn how to create a free MongoDB Atlas cluster and load the sample datasets, see the Get Started with PyMongo.

## Create a Compound Index

The following example creates a compound index on the `type` and `genre` fields:

```python
movies.create_index([("type", pymongo.ASCENDING), ("genre", pymongo.ASCENDING)])
```

The following is an example of a query that uses the index created in the preceding code example:

```python
query = { "type": "movie", "genre": "Drama" }
sort = [("type", pymongo.ASCENDING), ("genre", pymongo.ASCENDING)]

cursor = movies.find(query).sort(sort)
```
cursor = movies.find(query).sort(sort)
```

For more information, see Compound Indexes in the MongoDB Server manual.
Previous Versions
# Previous Versions

The following links direct you to documentation for previous versions of PyMongo.

- Version 4.6

- Version 4.5

- Version 4.4

- Version 4.3

- Version 4.2

- Version 4.1

- Version 4.0
About MongoDB Documentation
# About MongoDB Documentation

The MongoDB Manual contains comprehensive documentation on MongoDB. This page describes the manual's licensing, editions, and versions, and describes how to make a change request and how to contribute to the manual.

## License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License

© MongoDB, Inc. 2008-2022

## Man Pages

In addition to the MongoDB Manual, you can access the MongoDB Man Pages, which are also distributed with the official MongoDB Packages.

## Version and Revisions

This version of the manual reflects version 7.0 of MongoDB.

See the MongoDB Documentation Project Page for an overview of all editions and output formats of the MongoDB Manual. You can see the full revision history and track ongoing improvements and additions for all versions of the manual from its GitHub repository.
The most up-to-date, current, and stable version of the manual is always available at "https://www.mongodb.com/docs/manual/".

## Report an Issue or Make a Change Request

To report an issue with this manual or to make a change request, file a ticket at the MongoDB DOCS Project on Jira.

## Contribute to the Documentation

The entire documentation source for this manual is available in the mongodb/docs repository, which is one of the MongoDB project repositories on GitHub.

To contribute to the documentation, you can open a GitHub account, fork the mongodb/docs repository, make a change, and issue a pull request.

In order for the documentation team to accept your change, you must complete the MongoDB Contributor Agreement.

You can clone the repository by issuing the following command at your system shell:

```bash
git clone git://github.com/mongodb/docs.git
```

### About the Documentation Process
```bash
git clone git://github.com/mongodb/docs.git
```

### About the Documentation Process

The MongoDB Manual uses Sphinx, a sophisticated documentation engine built upon Python Docutils. The original reStructured Text files, as well as all necessary Sphinx extensions and build tools, are available in the same repository as the documentation.

For more information on the MongoDB documentation process, see the Meta Documentation.

If you have any questions, please feel free to open a Jira Case.
Administration
# Administration

The administration documentation addresses the ongoing operation and maintenance of MongoDB instances and deployments. This documentation includes both high level overviews of these concerns as well as tutorials that cover specific procedures and processes for operating MongoDB.
Backup and Restore Sharded Clusters
# Backup and Restore Sharded Clusters

The following tutorials describe backup and restoration for sharded clusters:

To use `mongodump` and `mongorestore` as a backup strategy for sharded clusters, you must stop the sharded cluster balancer and use the `fsync` command or the `db.fsyncLock()` method on `mongos` to block writes on the cluster during backups.

Sharded clusters can also use one of the following coordinated backup and restore processes, which maintain the atomicity guarantees of transactions across shards:

- MongoDB Atlas

- MongoDB Cloud Manager

- MongoDB Ops Manager

Use file system snapshots back up each component in the sharded cluster individually. The procedure involves stopping the cluster balancer. If your system configuration allows file system backups, this might be more efficient than using MongoDB tools.

Create backups using `mongodump` to back up each component in the cluster individually.
Create backups using `mongodump` to back up each component in the cluster individually.

Limit the operation of the cluster balancer to provide a window for regular backup operations.

An outline of the procedure and consideration for restoring an *entire* sharded cluster from backup.
Configuration and Maintenance
# Configuration and Maintenance

This section describes routine management operations, including updating your MongoDB deployment's configuration.

Outlines common MongoDB configurations and examples of best-practice configurations for common use cases.

Upgrade a MongoDB deployment to a different patch release within the same major release series.

Start, configure, and manage running `mongod` process.

Stop in progress MongoDB client operations using `db.killOp()` and `maxTimeMS()`.

Archive the current log files and start new ones.
Halting Development on MongoDB Swift Driver
# Halting Development on MongoDB Swift Driver

MongoDB is halting development on our server-side Swift driver. We remain excited about Swift and will continue our development of our mobile Swift SDK.

We released our server-side Swift driver in 2020 as an open source project and are incredibly proud of the work that our engineering team has contributed to the Swift community over the last four years. Unfortunately, today we are announcing our decision to stop development of the MongoDB server-side Swift driver. We understand that this news may come as a disappointment to the community of current users.

There are still ways to use MongoDB with Swift:

 - Use the MongoDB driver with server-side Swift applications as is 
 - Use the MongoDB C Driver directly in your server-side Swift projects
 - Usage of another community Swift driver, mongokitten
Community members and developers are welcome to fork our existing driver and add features as you see fit - the Swift driver is under the Apache 2.0 license and source code is available on GitHub. For those developing client/mobile applications, MongoDB offers the Realm Swift SDK with real time sync to MongoDB Atlas.

We would like to take this opportunity to express our heartfelt appreciation for the enthusiastic support that the Swift community has shown for MongoDB. Your loyalty and feedback have been invaluable to us throughout our journey, and we hope to resume development on the server-side Swift driver in the future.