## 1. Project Overview & Quickstart (mongodb/primary_only_service)

# primary_only_service

Open-source repository mongodb/primary_only_service

### Repository Details
- **Repository:** [mongodb/primary_only_service](https://github.com/mongodb/primary_only_service)
- **Primary Language:** Code

*Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.*

## 2. Official Technical Reference & Guides (mongodb/docs)

## File: README.md

# Docs Monorepo

## Selecting PR Template

When creating a pull request, you can automatically populate the
description with a template by adding a query parameter to the URL. We
provide the following templates:

- Platform changes: Use `?template=platform.md`
- Code Example Tests changes: Use `?template=code.md`
- Content changes: Use `?template=content.md`
- Drivers changes: Use `?template=drivers.md`
- Cloud Docs changes: Use `?template=cloud.md`
- Agent Skill changes: Use `?template=agent-skill.md`

For example:

```curl
https://github.com/example/exampleChanges/compare/test?expand=1&template=template.md
```

## Context7

The `context7.json` file in the root of the repository is used to prove our ownership of the MongoDB docs to Context7.

---

## File: source/includes/qe-tutorials/csharp/README.md

# C# Queryable Encryption Tutorial

This project demonstrates an example implementation of Queryable Encryption
for the MongoDB C#/.NET driver. To learn more about Queryable Encryption, see the
[Queryable Encryption](https://www.mongodb.com/docs/manual/core/queryable-encryption/)
section in the Server manual.

## Install Dependencies

To run this sample application, you first need to install the following
dependencies:

- MongoDB Server version 7.0 or later
- Automatic Encryption Shared Library version 7.0 or later
- [.NET version 7.0 or later](https://dotnet.microsoft.com/en-us/download/dotnet)

For more information on installation requirements for Queryable Encryption, see
[Installation Requirements](https://www.mongodb.com/docs/manual/core/queryable-encryption/install/#std-label-qe-install).

## Configure Your Environment

1. Copy the `appsettings_template.json` file in the root of the project directory to a file named `appsettings.json`.

2. Replace the placeholder values in the `appsettings.json` file with your own credentials.

3. Start a MongoDB replica set with three nodes.

   **Note:** If you are using [mtools](https://github.com/rueckstiess/mtools),
   you can create a replica set by running the following command:

   ```sh
   mlaunch init --replicaset --nodes 3
   ```

## Run the App

1. In a shell, navigate to the project root directory.

2. In `QueryableEncryptionTutorial.cs`, replace the placeholder `<your KMS
provider name>` with a valid KMS provider name.

3. Run `dotnet run QueryableEncryptionExample.csproj` to run the application.

4. If successful, the application will print a document to the console.

---

## File: source/includes/qe-tutorials/go/README.md

# Golang Queryable Encryption Tutorial

This project demonstrates an example implementation of Queryable Encryption
for the MongoDB Golang driver. To learn more about Queryable Encryption, see the
[Queryable Encryption](https://www.mongodb.com/docs/manual/core/queryable-encryption/)
section in the Server manual.

The following sections provide instructions on how to set up and run this project.

## Install Dependencies

To run this sample app, you first need to install the following
dependencies:

- MongoDB Server version 7.0 or later
- Automatic Encryption Shared Library version 7.0 or later
- Golang v1.13 or later
- libmongocrypt v1.8.0 or later

For more information on installation requirements for Queryable Encryption,
see [Installation Requirements](https://www.mongodb.com/docs/manual/core/queryable-encryption/install/#std-label-qe-install).

## Configure Your Environment

1. Copy the `env_template` file in the root of the project directory to a file named `.env`.

1. Replace the placeholder values in the `.env` file with your own credentials.

1. Start a MongoDB replica set with three nodes.

   **Note:** If you are using [mtools](https://github.com/rueckstiess/mtools),
   you can create a replica set by running the following command:

   ```sh
   mlaunch init --replicaset --nodes 3
   ```

## Run the App

1. In the `queryable-encryption-tutorial.go` file, replace the value
   of `<Your KMS Provider Name>` with the name of your KMS provider.

1. From the project root, run the following build command which
   downloads the dependencies defined in the `go.mod` file:

   ```golang
   go get go-qe-tutorial
   ```

1. Run the following command to compile the application:

   ```golang
   go build -tags cse
   ```

   **_Note:_**
   The `cse` build tag specifies support for Client-Side Encryption.

   For more information on compatible package versions, see the
   [Driver Compatibility Table](https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/compatibility/).

1. Run the compiled app with the following command:

   ```sh
   ./go-qe-tutorial
   ```

1. If successful, the application will print the sample document to the console.

---

## File: source/includes/qe-tutorials/java/README.md

# Java Queryable Encryption Tutorial

This project demonstrates an example implementation of Queryable Encryption
for the MongoDB Java driver. To learn more about Queryable Encryption, see the
[Queryable Encryption](https://www.mongodb.com/docs/manual/core/queryable-encryption/)
section in the Server manual.

The following sections provide instructions on how to
set up and run this project.

## Install Dependencies

To run this sample app, you first need to install the following
dependencies:

- MongoDB Server version 7.0 or later
- Automatic Encryption Shared Library version 7.0 or later
- Java 11 or later

For more information on installation requirements for Queryable Encryption,
see [Installation Requirements](https://www.mongodb.com/docs/manual/core/queryable-encryption/install/#std-label-qe-install).

## Configure Your Environment

1. Copy the `env_template` file in the root of the project directory to a file named `.env`.

1. Replace the placeholder values in the `.env` file with your own credentials.
   For more information on setting credentials, see
   [Queryable Encryption Tutorials](https://www.mongodb.com/docs/manual/core/queryable-encryption/tutorials/)
   for KMS credentials or the
   [Quick Start](https://www.mongodb.com/docs/manual/core/queryable-encryption/quick-start/)
   for local key provider credentials.

1. Start a MongoDB replica set with three nodes.

   **Note:** If you are using [mtools](https://github.com/rueckstiess/mtools),
   you can create a replica set by running the following command:

   ```sh
   mlaunch init --replicaset --nodes 3
   ```

## Run the App

> **Note:** We recommend you use an IDE such as IntelliJ to manage your
> project, its dependencies and JVM options.

1. Download the project dependencies.

   - If you use Maven, you can use the
     `pom.xml` file included in the project directory.
   - If you use Gradle, you can use the `gradle.build` file included in the project directory.

   Otherwise, make sure you
   include dependencies for `mongodb-driver-sync`, `mongodb-driver-core`, `bson`
   and `mongodb-crypt` that are compatible with Queryable Encryption. This
   project also uses the `dotenv-java` package to read your credentials from a
   file.

   For more information on compatible package versions, see the
   [Driver Compatibility Table](https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/compatibility/).

1. (Optional) If you are using KMIP for key management, you need to add
   the location of your keystore and truststore to the JVM options.

   - If you are using Maven, open the `maven.config.tpl` file in the project
     directory to view the JVM options. Assign the appropriate values and add
     these JVM options to your run configuration.

   - If you are using Gradle, open the `gradle.build` file in the project
     directory, uncomment the `applicationDefaultJvmArgs` array. Assign the
     appropriate values to the placeholders.

1. In `QueryableEncryptionTutorial.java`, which you can find in the
   `/java/src/main/com/mongodb/tutorials/qe/` directory, replace the placeholder
   `<Your KMS Provider Name>` with a valid KMS provider name.

1. Compile the project and run the `QueryableEncryptionTutorial.java` class in
   the `/java/src/main/java/com/mongodb/tutorials/qe/` directory.

   - If you are using `maven` on the command line, you can run the following
     commands from the project root that contains the `pom.xml` to build and run
     it.

     > **Note:** If you are using KMIP for key management, add the VM options to the `java` command.

     ```
     mvn clean package
     java -jar target/queryable-encryption-tutorial.jar
     ```

   - If you are using `gradle` on the command line, you can run the following
     command from the project root that contains the `gradle.build` file to
     build and run the project.

     ```
     gradle clean build run
     ```

   Otherwise, follow the procedure for running a project in your IDE.

1. If successful, the application will print the sample document to the console.

---

## File: source/includes/qe-tutorials/mongosh/README.md

# mongosh Queryable Encryption Tutorial

This `README` details how to set up and run the sample application for the
mongosh Queryable Encryption tutorial.

## Install Dependencies

To run this sample application, you first need to install the following
dependencies:

- MongoDB Server version 7.0 or later
- [mongosh](https://www.mongodb.com/try/download/shell)
- [direnv](https://direnv.net/docs/installation.html) to assign your KMS
  credentials to environment variables.

Do not install mongosh via homebrew on Mac OS. See 
https://jira.mongodb.org/browse/MONGOSH-1216 for details.

For more information on installation requirements for {+qe+}, see [Installation Requirements](https://www.mongodb.com/docs/manual/core/queryable-encryption/install/#std-label-qe-install).

## Configure Your Environment

1. Create a file in the root of your directory named `.envrc`.

1. Copy the contents of `envrc_template` into the `.envrc` file.

1. Replace the placeholder values in the ``.envrc`` file with your own credentials.

1. Create a three-node replica set.

   > **Note:** If you are using `mtools`, you can create a replica set with the
   > following command:
   >
   > `mlaunch init --replicaset --nodes 3`

## Run the Application

1. In a shell, navigate to the directory in which the application
   is saved.

1. Run `direnv allow` to load the environment variables defined in your `.envrc`
   file into your environment.

   > **Note:** `direnv allow` only needs to be run the first time you are
   > running this application.

1. In `queryable-encryption-tutorial.js`, Replace the placeholder `<Your KMS
Provider Name>` with a valid KMS provider name.

1. Run `mongosh -f queryable-encryption-tutorial.js` to run the application.

1. If successful, the application will print a document to the console.

---

## File: source/includes/qe-tutorials/node/README.md

# Node.js Queryable Encryption Tutorial

This project demonstrates an example implementation of Queryable Encryption
for the MongoDB Node.js driver. To learn more about Queryable Encryption, see the
[Queryable Encryption](https://www.mongodb.com/docs/manual/core/queryable-encryption/)
section in the Server manual.

## Install Dependencies

To run this sample application, you first need to install the following
dependencies:

- MongoDB Server version 7.0 or later
- Automatic Encryption Shared Library version 7.0 or later
- Node.js
- npm

For more information on installation requirements for {+qe+}, see [Installation Requirements](https://www.mongodb.com/docs/manual/core/queryable-encryption/install/#std-label-qe-install).

## Configure Your Environment

1. Copy the `env_template` file in the root of the project directory to a file named `.env`.

1. Replace the placeholder values in the `.env` file with your own credentials.

1. Start a MongoDB replica set with three nodes.

   **Note:** If you are using [mtools](https://github.com/rueckstiess/mtools),
   you can create a replica set by running the following command:

   ```sh
   mlaunch init --replicaset --nodes 3
   ```

## Run the App

1. In a shell, navigate to the project root directory.

1. Run `npm install` to install the Node.js driver and
   `mongodb-client-encryption` packages.

   > **Note:** `mongodb-client-encryption` must be version 2.8.0 or later.
   > For more information on compatible package versions, see the
   > [Driver Compatibility Table](https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/compatibility/).
   >
   > When using Node.js driver version `6.0.0` or later,
   > `mongodb-client-encryption` must have the same major version number as the driver.

1. In `queryable-encryption-tutorial.js`, replace the placeholder `<Your KMS
Provider Name>` with a valid KMS provider name.

1. Run `node queryable-encryption-tutorial` to start the app.

1. If successful, the application will print a document to the console.

---

## File: source/includes/qe-tutorials/python/README.md

# Python Queryable Encryption Tutorial

This project demonstrates an example implementation of Queryable Encryption
for the PyMongo driver. To learn more about Queryable Encryption, see the
[Queryable Encryption](https://www.mongodb.com/docs/manual/core/queryable-encryption/quick-start/)
section in the Server manual.

The following sections provide instructions on how to set up and run this project.

## Install Dependencies

To run this sample app, you first need to install the following
dependencies:

- MongoDB Server version 7.0 or later
- Automatic Encryption Shared Library version 7.0 or later
- `python3`
- `pip`

For more information on installation requirements for Queryable Encryption,
see [Installation Requirements](https://www.mongodb.com/docs/manual/core/queryable-encryption/install/#std-label-qe-install).

## Configure Your Environment

1. Create a file in the root of your directory named `.env`.

1. Copy the contents of `envrc_template` into the `.env` file.

1. Replace the placeholder values in the `.env` file with your own credentials.
   For more information on setting credentials, see
   [Queryable Encryption Tutorials](https://www.mongodb.com/docs/manual/core/queryable-encryption/tutorials/)
   for KMS credentials or the
   [Quick Start](https://www.mongodb.com/docs/manual/core/queryable-encryption/quick-start/)
   for local key provider credentials.

   > **Note:** The sample application uses the `pydotenv` package to access
   > the credentials as if they were defined as environment variables, but
   > does not overwrite any environment variables you currently have set.

1. Create a three-node replica set.

   **Note:** If you are using [mtools](https://github.com/rueckstiess/mtools),
   you can create a replica set by running the following command:

   ```sh
   mlaunch init --replicaset --nodes 3
   ```

## Run the Application

1. In a shell, navigate to the directory in which the application
   is saved.

1. Run `python3 -m pip install -r requirements.txt` to install the Python driver and
   `pymongocrypt`.

1. In `queryable-encryption-tutorial.py`, replace the placeholder `<Your KMS
   Provider Name>` with a valid KMS provider name.

1. Run `python3 queryable_encryption_tutorial.py` to run the application.

1. If successful, the application will print the sample document to the console.

---

## File: README.rst

=====================
MongoDB Documentation
=====================

This repository contains a major revision of the MongoDB documentation,
currently accessible at https://www.mongodb.com/docs/manual/. You can build
the documentation locally if you have `giza
<https://pypi.python.org/pypi/giza>`_ installed: ::

     python2 -m pip install giza
     git clone https://github.com/mongodb/docs.git
     cd docs/
     make html

If successful, the built HTML files will be located in ``build//html/`` (for example ``build/master/html/`` when on the git ``master`` branch).

Contribute
----------

The MongoDB Documentation Project is governed by the terms of the
`MongoDB Contributor Agreement
<https://www.mongodb.com/legal/contributor-agreement>`_.

To contribute to the documentation, 

- If you have not done so already, please sign the `MongoDB Contributor Agreement <https://www.mongodb.com/legal/contributor-agreement>`_.

- Fork this repository on GitHub and issue a pull request. 

Report Issues
-------------

To file issues or requests regarding the documentation, go to the
`Documentation Jira Project <https://jira.mongodb.org/browse/DOCS>`_.

License
-------

All documentation is available under the terms of a `Creative Commons
License <https://creativecommons.org/licenses/by-nc-sa/3.0/>`_.

If you have any questions, please contact `docs@mongodb.com
<mailto:docs@mongodb.com>`_.

-- The MongoDB Documentation Team