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

# MongoDB

[Updated in 4.88](https://docs-classic.cognigy.com/release-notes/4.88.md)

![MongoDB Node configuration panel with find operation](https://mintcdn.com/cognigy-docs-legacy/sbu8K_1z3Hht9e7i/_assets/ai/develop/node-reference/services/mongo-db-find.png?fit=max\&auto=format\&n=sbu8K_1z3Hht9e7i\&q=85\&s=a89cb7bf174c972f994a35ab6474f3ad)

## Description

The MongoDB Nodes let you execute a range of operations on your [MongoDB](https://www.mongodb.com/docs/).

## Restrictions

* MongoDB Nodes are compatible with MongoDB 3.6 or later versions.

## Nodes

### Find

| Parameter | Type | Description |
| - | - | - |
| MongoDB Connection | List | Select MongoDB database connection. To create a new connection, click ![add MongoDB connection](https://mintcdn.com/cognigy-docs-legacy/eGdkyf6N-EPpPKZA/_assets/icons/plus-simple.svg?fit=max\&auto=format\&n=eGdkyf6N-EPpPKZA\&q=85\&s=adfb44a61ca10e2b43ef42bbe4306753). |
| Collection | CognigyScript | The name of the MongoDB collection. |
| Query | JSON | The MongoDB query. [MongoDB Documentation: Find](https://docs.mongodb.com/manual/reference/method/db.collection.find/) |

> [accordion] Result Storage
>
> | Parameter | Type | Description |
> | - | - | - |
> | Where to store the result | List | <ul><li>**Input** — stores the result in the Input object.</li><li>**Context** — stores the result in the Context object.</li></ul> |
> | Input Key to store Result | CognigyScript | Enter the key where the result should be stored. |

> [accordion] Advanced
>
> | Parameter | Type | Description |
> | - | - | - |
> | Projection | JSON | Read the MongoDB documentation for more information on Projection. [MongoDB Documentation: Projection](https://docs.mongodb.com/manual/reference/operator/projection/) |
> | Options | JSON | Read the MongoDB documentation for configurable options. [MongoDB Documentation](https://docs.mongodb.com/manual) |
> | Index | CognigyScript | Refer to the MongoDB documentation on Indexes. [MongoDB Documentation: Indexes](https://docs.mongodb.com/manual/indexes/) |
> | Stop on Error | Toggle | Lets you configure whether to stop flow execution when an error occurs or not. |

> [accordion] Caching
>
> | Parameter | Type | Description |
> | - | - | - |
> | Cache Response from MongoDB Operation | Toggle | Whether to cache the MongoDB responses to optimize performance. |
> | The expiration time of the cache (in s) | Number | The expiration time in seconds of the cache. |

### Find One

| Parameter | Type | Description |
| - | - | - |
| MongoDB Connection | List | Select MongoDB database connection. To create a new connection, click ![add MongoDB connection](https://mintcdn.com/cognigy-docs-legacy/eGdkyf6N-EPpPKZA/_assets/icons/plus-simple.svg?fit=max\&auto=format\&n=eGdkyf6N-EPpPKZA\&q=85\&s=adfb44a61ca10e2b43ef42bbe4306753). |
| Collection | CognigyScript | The name of the MongoDB collection. |
| Query | JSON | The MongoDB query. [MongoDB Documentation: FindOne](https://docs.mongodb.com/manual/reference/method/db.collection.findOne/) |

> [accordion] Result Storage
>
> | Parameter | Type | Description |
> | - | - | - |
> | Where to store the result | List | <ul><li>**Input** — stores the result in the Input object.</li><li>**Context** — stores the result in the Context object.</li></ul> |
> | Input Key to store Result | CognigyScript | Enter the key where the result should be stored. |

> [accordion] Advanced
>
> | Parameter | Type | Description |
> | - | - | - |
> | Projection | JSON | Read the MongoDB documentation for more information on Projection. [MongoDB Documentation: Projection](https://docs.mongodb.com/manual/reference/operator/projection/) |
> | Options | JSON | Read the MongoDB documentation for configurable options. [MongoDB Documentation](https://docs.mongodb.com/manual) |
> | Stop on Error | Toggle | Lets you configure whether to stop flow execution when an error occurs or not. |

> [accordion] Caching
>
> | Parameter | Type | Description |
> | - | - | - |
> | Cache Response from MongoDB Operation | Toggle | Whether to cache the MongoDB responses to optimize performance. |
> | The expiration time of the cache (in s) | Number | The expiration time in seconds of the cache. |

### Update One

| Parameter | Type | Description |
| - | - | - |
| MongoDB Connection | List | Select MongoDB database connection. To create a new connection, click ![add MongoDB connection](https://mintcdn.com/cognigy-docs-legacy/eGdkyf6N-EPpPKZA/_assets/icons/plus-simple.svg?fit=max\&auto=format\&n=eGdkyf6N-EPpPKZA\&q=85\&s=adfb44a61ca10e2b43ef42bbe4306753). |
| Collection | CognigyScript | The name of the MongoDB collection. |
| Update | JSON | The MongoDB update payload in JSON format.[MongoDB Documentation: UpdateOne](https://docs.mongodb.com/manual/reference/method/db.collection.updateOne/) |

> [accordion] Result Storage
>
> | Parameter | Type | Description |
> | - | - | - |
> | Where to store the result | List | <ul><li>**Input** — stores the result in the Input object.</li><li>**Context** — stores the result in the Context object.</li></ul> |
> | Input Key to store Result | CognigyScript | Enter the key where the result should be stored. |

> [accordion] Advanced
>
> | Parameter | Type | Description |
> | - | - | - |
> | Use Operators | Toggle | If enabled, then you can use operators like `$push` in the update query. If not, then we will automatically \$set everything that you write in the update query into the database. |
> | Options | JSON | Read the MongoDB documentation for configurable options. [MongoDB Documentation](https://docs.mongodb.com/manual) |
> | Stop on Error | Toggle | Lets you configure whether to stop flow execution when an error occurs or not. |

### Update Many

[MongoDB Documentation: UpdateMany](https://docs.mongodb.com/manual/reference/method/db.collection.updateMany/)

### Insert

[MongoDB Documentation: Insert](https://docs.mongodb.com/manual/reference/method/db.collection.insert/)

### Remove

[MongoDB Documentation: Remove](https://docs.mongodb.com/manual/reference/method/db.collection.remove/)

### MongoDB Aggregate

[MongoDB Documentation: Aggregate](https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/)


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