> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MongoDB

> Store Prisma AIRS AI Gateway logs in MongoDB for hybrid deployments

> [!NOTE]
>
> Available on hybrid deployments.

A hybrid AI Gateway deployment can store all LLM logs in MongoDB for scalable, high-performance logging in production AI apps.

> [!NOTE]
>
> The AI Gateway is part of the [MongoDB partner ecosystem](https://cloud.mongodb.com/ecosystem/portkey-ai).

## Prerequisites

* Hybrid AI Gateway deployment
* MongoDB instance
* Kubernetes cluster

> **[Helm Charts Repo](https://github.com/Portkey-AI/helm-chart/tree/main/helm/enterprise)**
>
> Ready-to-use Kubernetes configs

## Configuration

Add these values to your `values.yaml`:

```yaml theme={"system"}
MONGO_DB_CONNECTION_URL:
MONGO_DATABASE:
MONGO_COLLECTION_NAME:
MONGO_GENERATION_HOOKS_COLLECTION_NAME:
```

### PEM File Authentication

**1. Add PEM File**

In `resources-config.yaml`, add your certificate:

```yaml theme={"system"}
data:
  document_db.pem: |
    -----BEGIN CERTIFICATE-----
    Your certificate content here
    -----END CERTIFICATE-----
```

**2. Configure Volumes**

In `values.yaml`:

```yaml theme={"system"}
volumes:
  - name: shared-folder
    configMap:
      name: resource-config
volumeMounts:
  - name: shared-folder
    mountPath: /etc/shared/<shared_pem>
    subPath: <shared_pem>
```

**3. Update Connection URL**

```sh theme={"system"}
mongodb://<user>:<password>@<host>?tls=true&tlsCAFile=/etc/shared/document_db.pem&retryWrites=false
```

> [!NOTE]
>
> [Full details in the Helm chart repo](https://github.com/Portkey-AI/helm-chart/blob/main/helm/enterprise/README.md).

## Cloud Deployment

Deploy the AI Gateway with MongoDB on:

> **[AWS](https://docs.portkey.ai/docs/aigw/self-hosting/hybrid-deployments/aws/eks.md)**

> **[Azure](https://docs.portkey.ai/docs/aigw/self-hosting/hybrid-deployments/azure/aks.md)**

> **[GCP](https://docs.portkey.ai/docs/aigw/self-hosting/hybrid-deployments/gcp.md)**

[Explore the AI Gateway’s features →](https://docs.portkey.ai/docs/aigw/introduction/feature-overview.md)


## Related topics

- [Deployment Components](https://docs.portkey.ai/docs/aigw/product/enterprise-offering/components.md)
- [Architecture](https://docs.portkey.ai/docs/aigw/self-hosting/hybrid-deployments/architecture.md)
- [AWS Bedrock Knowledge Bases](https://docs.portkey.ai/docs/aigw/integrations/llms/bedrock/bedrock-knowledgebase.md)
- [Overview](https://docs.portkey.ai/docs/aigw/integrations/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.