Skip to main content

MongoDB Component

Interact with documents in a MongoDB database

Component key: mongo

Description#

MongoDB is a NoSQL database program that uses JSON-like documents with optional schemas. This component allows you to create, read, update, and delete documents inside a MongoDB collection.

Authorization Notes#

The MongoDB username and password can be put directly into a basic auth credential, alongside the database host, port, database, and collection in their respective config variables.

Actions#

Create Index#

Creates an index on the specified field in a collection | key: createIndex

InputKeyDefaultNotesExample

Collection

string
/ Required
collectionProvide the name of your desired collection.Customers

Database

string
/ Required
databaseadmin

Host

string
/ Required
hostProvide the host address or cluster URL on which your MongoDB server is running on.192.168.0.1

Port

string
/ Required
port27017Provide the port on which your MongoDB server is running on.27017

Query

string
queryFiltera:3Provide a key and value pair that matches your desired document.

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

Output Example Payload#

{  "data": ""}

Delete Many#

Remove documents from a collection | key: deleteMany

InputKeyDefaultNotesExample

Collection

string
/ Required
collectionProvide the name of your desired collection.Customers

Database

string
/ Required
databaseadmin

Value

data
/ Required
documentProvide key and value pairs that make up the body of your document.value

Host

string
/ Required
hostProvide the host address or cluster URL on which your MongoDB server is running on.192.168.0.1

Port

string
/ Required
port27017Provide the port on which your MongoDB server is running on.27017

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

Output Example Payload#

{  "data": {    "acknowledged": true,    "deletedCount": 1  }}

Find All#

Retrieve all documents in a collection | key: findAll

InputKeyDefaultNotesExample

Collection

string
/ Required
collectionProvide the name of your desired collection.Customers

Database

string
/ Required
databaseadmin

Host

string
/ Required
hostProvide the host address or cluster URL on which your MongoDB server is running on.192.168.0.1

Port

string
/ Required
port27017Provide the port on which your MongoDB server is running on.27017

Query

string
queryFiltera:3Provide a key and value pair that matches your desired document.

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

Output Example Payload#

{  "data": [    {      "_id": "610ae111774d8aaef3b5d2eb",      "exampleKey": "exampleValue"    }  ]}

Insert Many#

Insert new documents into a collection | key: insertMany

InputKeyDefaultNotesExample

Collection

string
/ Required
collectionProvide the name of your desired collection.Customers

Database

string
/ Required
databaseadmin

Documents List

data
/ Required
documentListFor each item, provide a document ( Javascript Object ) to be inserted into the collection.

Host

string
/ Required
hostProvide the host address or cluster URL on which your MongoDB server is running on.192.168.0.1

Port

string
/ Required
port27017Provide the port on which your MongoDB server is running on.27017

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

Output Example Payload#

{  "data": {    "acknowledged": true,    "insertedCount": 3,    "insertedIds": null  }}

Update One#

Update a single document in a collection | key: updateOne

InputKeyDefaultNotesExample

Collection

string
/ Required
collectionProvide the name of your desired collection.Customers

Database

string
/ Required
databaseadmin

Value

data
/ Required
documentProvide key and value pairs that make up the body of your document.value

Update Fields

data
documentUpdateProvide key and value pairs to be inserted/updated in your document.{ b: 3 }

Host

string
/ Required
hostProvide the host address or cluster URL on which your MongoDB server is running on.192.168.0.1

Port

string
/ Required
port27017Provide the port on which your MongoDB server is running on.27017

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

Output Example Payload#

{  "data": {    "acknowledged": true,    "modifiedCount": 1,    "upsertedId": null,    "upsertedCount": 0,    "matchedCount": 1  }}