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.

MongoDB Connections#

Mongo Connection#

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.

InputDefaultNotesExample
Input
Collection
string
/ Required
Default
 
Notes
Provide the name of your desired collection.
Example
Customers
Input
Database
string
/ Required
Default
 
Notes
The database name in your MongoDB server.
Example
admin
Input
Host
string
/ Required
Default
192.168.0.1
Notes
Provide the host address or cluster URL on which your MongoDB server is running on.
Example
 
Input
Password
string
Default
 
Notes
 
Example
 
Input
Port
string
/ Required
Default
27017
Notes
The port of the MongoDB server.
Example
 
Input
Username
string
Default
 
Notes
 
Example
 

Actions#

Create Index#

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

InputDefaultNotes
Input
Connection
connection
/ Required
Default
 
Notes
 
Input
Query
string
Key Value List
Default
a:3
Notes
Provide a key and value pair that matches your desired document.

Output Example Payload#

{  "data": ""}

Delete Many#

Remove documents from a collection | key: deleteMany

InputNotesExample
Input
Value
data
/ Required
Key Value List
Notes
Provide key and value pairs that make up the body of your document.
Example
value
Input
Connection
connection
/ Required
Notes
 
Example
 

Output Example Payload#

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

Find All#

Retrieve all documents in a collection | key: findAll

InputDefaultNotes
Input
Connection
connection
/ Required
Default
 
Notes
 
Input
Query
string
Key Value List
Default
a:3
Notes
Provide 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

InputNotes
Input
Documents List
data
/ Required
Value List
Notes
For each item, provide a document ( Javascript Object ) to be inserted into the collection.
Input
Connection
connection
/ Required
Notes
 

Output Example Payload#

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

Update One#

Update a single document in a collection | key: updateOne

InputNotesExample
Input
Value
data
/ Required
Key Value List
Notes
Provide key and value pairs that make up the body of your document.
Example
value
Input
Update Fields
data
Key Value List
Notes
Provide key and value pairs to be inserted/updated in your document.
Example
{ b: 3 }
Input
Connection
connection
/ Required
Notes
 
Example
 

Output Example Payload#

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