Update collection in MongoDB

This example pipeline demonstrates how to update a MongoDB collection with data from an upstream Snap using update query conditions.


MongoDB Update Collection Example Pipeline

  1. Configure the JSON Generator Snap with the data to be updated to the MongoDB collections.

    JSON Generator configuration

  2. Configure the MongoDB Update Snap with the collection name, Sample data, to be updated with the values just passed from the upstream JSON Generator Snap.

    The update query condition "{field002:'"+$field002+"'}" is passed (with the expression enabled) to update the documents in the collection.


    MongoDB Update Snap configuration

  3. Validate the pipeline.
    The successful execution of the pipeline displays the output preview showing the updated documents.
    MongoDB Update output

To successfully reuse pipelines:
  1. Download and import the pipeline into SnapLogic.
  2. Configure Snap accounts as applicable.
  3. Provide pipeline parameters as applicable.