--- title: "Upsert Document" slug: "upsert-document" updated: 2025-11-05T19:42:06Z published: 2025-11-05T19:42:06Z canonical: "documentation.decisions.com/upsert-document" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Upsert Document | Step Details | | --- | | **Introduced in Version** | 9.17 | | **Last Modified in Version** | 9.17 | | **Location** | Integration > MongoDB | The **Upsert Document** Step inserts or updates a document in a MongoDB collection based on defined filter criteria. If a document matching the specified filter exists, it is updated with the new values; otherwise, a new document is inserted. When the selected Document Type includes an ID property (or another filter field), that property is used for matching and will update or populate automatically depending on whether the document already exists. ### Prerequisites - Install the [MongoDB](https://documentation.decisions.com/docs/mongodb) Module. - **For v9 Users**: Add a [Project Dependency](https://documentation.decisions.com/docs/project-dependencies#add-a-project-dependency-or-enable-a-module) once the MongoDB Module is installed. --- ## Properties #### Settings | Property | Description | Data Type | | --- | --- | --- | | Document Type | Allows Users to specify a Document Type used for inserting or updating documents in the MongoDB collection. | Varies | | Filter Criteria | Defines the conditions used to identify an existing document for update. If no document matches these criteria, a new document is inserted. When editing the Filter Criteria, the following fields can be configured: - **Filter Type -**Determines the kind of filter to apply: - *Field Name*: Filters by a single field in the document. - *Nested Document Field Name*: Filters by a field within a nested document. - *Combine Filters (AND)*: Groups multiple filters with a logical AND. - *Combine Filters (OR)*: Groups multiple filters with a logical OR. - **Field Name** **-** Selects the document field to filter on (e.g., *Int1*, *id*, *str1* for a Document Type named *MongoDBType*). - **Query Match Type** – Specifies how the value should be compared. Options include *Equals*, *DoesNotEqual*, *Exists*, *DoesNotExist*, *LessThan*, *GreaterThan*, *GreaterThanOrEqualTo*, and *LessThanOrEqualTo*. - **Input Data Alias (Optional)** | Varies | #### Inputs | Property | Description | Data Type | | --- | --- | --- | | Documents | Allows Users to specify a list of documents to insert or update based on the defined Filter Criteria. | Varies (Depends on the Document Type) | #### ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1762368559879.png)![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1762371581151.png) --- Related Information [MongoDB Module Overview](https://documentation.decisions.com/docs/mongodb)