Skip to main content

MongoDB / Azure Cosmos DB / Amazon DocumentDB

Our current quickstart tutorial covers this in further detail.

Defining the database

  1. Define a globals section
  2. Add the databases field
  3. Add a database identifier
  4. Set the driver to mongodb (you will use the same driver for Azure Cosmos DB and Amazon DocumentDB)
  5. Add the connection string

For all available database and document_operation options see database inputs

See all the available operations under document_operation.

Adding the database to your action

  1. Add a database input to your action
  2. Pass the database identifier from the globals section main if defined or redefine a new database

View the steps in the quickstart tutorial on adding a connection here.

Using Operations

View the quickstart tutorial here.

MongoDB Find Example

Example to send a HTTP POST with a JSON payload eg. {"name": "test"} to find a document with username called test.

MongoDB Find
loading...

MongoDB Aggregate Example

Example to send a HTTP POST with a JSON payload eg. {"starts_with": "test"} to find documents using regex and limiting the result set to 30.

MongoDB Aggregate Pipeline
loading...

MongoDB Combined find and update

  • Send a HTTP POST with a JSON payload eg. {"name": "something"} to mongodb/find to find a document with a matching name.
  • Send a HTTP POST with a JSON payload eg. {"name": "something", "status": false} to mongodb/update to find a document with a matching name and update the status value accordingly.
MongoDB Find and update
loading...