Have Questions?  Need Expert Answers?  JOIN LUNCH N' LEARNS!

Upsert Document

Prev Next
Step Details
Introduced in Version9.17
Last Modified in Version9.17
LocationIntegration > 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 


Properties

Settings

PropertyDescriptionData Type
Document TypeAllows Users to specify a Document Type used for inserting or updating documents in the MongoDB collection.Varies
Filter CriteriaDefines 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

PropertyDescriptionData Type
DocumentsAllows Users to specify a list of documents to insert or update based on the defined Filter Criteria.Varies (Depends on the Document Type)


Related Information

MongoDB Module Overview