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#

Create a new MongoDB connection and enter the host, port, and database for your MongoDB server. The MongoDB username and password are optional inputs that can be put directly into a mongoDB connection.

MongoDB Connections#

Mongo Connection#

InputKeyDefaultNotesExample

Collection

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

Database

string
/ Required
databaseThe database name in your MongoDB server.admin

Host

string
/ Required
host192.168.0.1Provide the host address or cluster URL on which your MongoDB server is running on.

Password

string
password

Port

string
/ Required
port27017The port of the MongoDB server.

Username

string
username

Actions#

Create Index#

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

InputKeyDefaultNotes

Connection Input

connection
/ Required
mongoConnection

Query

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

Output Example Payload#

{  "data": ""}

Delete Many#

Remove documents from a collection | key: deleteMany

InputKeyNotesExample

Value

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

Connection Input

connection
/ Required
mongoConnection

Output Example Payload#

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

Find All#

Retrieve all documents in a collection | key: findAll

InputKeyDefaultNotes

Connection Input

connection
/ Required
mongoConnection

Query

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

Output Example Payload#

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

Insert Many#

Insert new documents into a collection | key: insertMany

InputKeyNotes

Documents List

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

Connection Input

connection
/ Required
mongoConnection

Output Example Payload#

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

Update One#

Update a single document in a collection | key: updateOne

InputKeyNotesExample

Value

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

Update Fields

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

Connection Input

connection
/ Required
mongoConnection

Output Example Payload#

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