• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

MongoDB

Status
Not open for further replies.
This documentation provides a detailed, step-by-step guide for integrating your MongoDB account with Pabbly Connect. Following these instructions will enable you to establish a seamless connection between the two platforms.

How to authorize MongoDB in Pabbly Connect?

Integration Steps:

1. Select "MongoDB" Trigger/Action:


Within Pabbly Connect, navigate to the action step and choose "MongoDB" as the application then in the action event select the event you wish to perform, such as "Create Record".


1730531731406.png



2. Configure the Connection:

To establish a connection, select "Add New Connection" and log in to your MongoDB account. If you already have an existing connection, you can opt for "Select Existing Connection" instead.


1730531251386.png


How to activate the permission on MongoDB to establish a proper connection.

Network Access Setup
:

  • Go to your MongoDB Atlas account.
  • Navigate to "Network Access" under "Security".
  • Click "Add IP Address" and enter your IP address to allow access to the MongoDB database from your location.
1730202688670.png

Obtain the connection string in Mongo DB:

  • Log in to your MongoDB account. In the left sidebar, click "Database > Clusters > Connect".
1730202728279.png


1730202896738.png


  1. Connection String Format:

Code:
Code:
mongodb+srv://<username>:<password>@myclass.9fnerah.mongodb.net/<database_name>?retryWrites=true&w=majority

Example:
Code:
mongodb+srv://John:[email protected]/Product?retryWrites=true&w=majority

Field Specifications

custom_json

  • Description: custom_json is a predefined JSON structure used within the API. This field has a fixed format, which ensures consistent data structures are maintained across different records.
Example:
JSON:
{"name":"John Doe",
"age":24
}

custom_data

  • Description: custom_data is a flexible field where users can create their own JSON structure. It allows JSON in MongoDB's canonical format and relaxed format, providing more flexibility for data input.
    • Canonical format: Standard MongoDB JSON format, ideal for explicitly defined keys and data types.
    • Relaxed format: More user-friendly, allowing JSON values to be interpreted in a simplified format (e.g., numbers as plain integers without quotes).
JSON:
     {
          "name": "John Doe",
           "age": {
                    "$numberInt": "28"
                },
                "isDeveloper": true,
                "createdAt": {
                    "$date": "2024-10-06T10:30:00Z"
                },
                "balance": {
                    "$numberDecimal": "1000.123456789"
                },
                "height": {
                    "$numberDouble": "5.75"
                },
                "Num1_64": {
                    "$numberLong": "546"
                },
                "Num2_32": {
                    "$numberInt": "10"
                },
                "infiniteNumber1": {
                    "$numberDouble": "Infinity"
                },
                      "bin04": {
                        "$binary": {
                            "base64": "NTUwZTg0MDBlMjliNDFkNGE3MTY0NDY2NTU0NDAwMDA=",
                            "subType": "00"
                        }
                    },
                "projects": [
                    {
                        "title": "Chat Application",
                        "year": {
                            "$numberInt": "2061"
                        },
                        "technologies": [
                            "React",
                            "Node.js",
                            "MongoDB"
                        ]
                    },
                    {
                        "title": "E-commerce Website",
                        "year": {
                            "$numberInt": "2024"
                        },
                        "technologies": [
                            "MERN Stack",
                            "Express"
                        ]
                    }
                ],
                "projects2": [
                    {
                        "title": "Chat Application 23",
                        "year": {
                            "$numberInt": "2025"
                        },
                        "technologies": [
                            "React",
                            "Node.js",
                            {
                                "$numberInt": "28"
                            }
                        ]
                    }
                ],
                "Regex_1": {
                    "$regularExpression": {
                        "pattern": "^Anurag$",
                        "options": "i"
                    }
                },
                "timestampField": {
                    "$timestamp": {
                        "t": 1565545664,
                        "i": 1
                    }
                },
                "uuid": {
                    "$uuid": "3b241101-e2bb-4255-8caf-4136c566a962"
                },
                "Binary_data_1": {
                    "bin1": {
                        "$binary": {
                            "base64": "SGVsbG8sIFdvcmxkIQ==",
                            "subType": "00"
                        }
                    },
                    "bin2": {
                        "$binary": {
                            "base64": "SGVsbG8gU2FyYW5zaCBLYWlzZSBobw==",
                            "subType": "00"
                        }
                    }
                },
                "userId": {
                    "$oid": "60ad4e26adf5692f72b57a28"
                }
            }

Unique Data:

  • Indexing: MongoDB's index feature is used to ensure data uniqueness in the database. By creating an index on specific fields, the database prevents duplicate records, enforcing unique data entries.
1730531298114.png


  • Unique Index: A unique index enforces uniqueness for all values in the specified field across documents within a collection. This is especially useful for fields such as usernames or email addresses, where duplicate values must be prevented.
Example: To create a unique index on a field:

Code:
db.collection.createIndex({ fieldName: 1 }, { unique: true });


  • Partial Index: A partial index indexes only the documents that meet defined criteria, effectively skipping over those that don’t. This approach saves storage space and enhances performance by excluding irrelevant documents.
Example: To index only documents where the status field is "active":
Code:
db.collection.createIndex({ fieldName: 1 }, { partialFilterExpression: { status: "active" } });

  • Sparse Index: A sparse index includes only the documents that contain a non-null value in the indexed field, omitting any documents where the field is missing or has a null value. This is useful when some documents lack a specific field, as it excludes these from the index, saving storage space and improving performance.
Example: To create a sparse index on the email field:

Code:
db.collection.createIndex({ optionalField: 1 }, { sparse: true });


  • Text Index: Text indexes enable full-text search on text fields, allowing efficient search for keywords within those fields. Only documents containing the specified text field are included in the index, automatically excluding documents without it.
Example: To create a text index on the description field:
Code:
db.collection.createIndex({ textField: "text" });


  • Compound Index: Compound indexes allow indexing on multiple fields within a single document, enabling efficient queries based on multiple criteria. They can also enforce uniqueness across a combination of fields, offering more flexible uniqueness constraints.

Example: To enforce a unique combination of username and email fields:

Code:
db.collection.createIndex({ username: 1, email: 1 }, { unique: true });

Note: To get a piece more information about indexing Learn more

Base64 Encoding:

For encoding values to Base64 format, you can use the following URL:
  • Base64 Encode Tool
    Select the Encode option for converting data to Base64 format as needed for your MongoDB documents.
1730202644101.png


MongoDB Documentation for Data Insertion:
MongoDB Canonical Format/Relaxed Format


========================== Actions ================================

1. Create Record:

Please follow below the step to capture the action response to the above-mentioned action event -

  • Use Case: To create a record within the collection in MongoDB.
  • Select the "Create Record" action, and connect your MongoDB account.
  • Provide all required details, including any custom JSON data you'd like added to your database.
  • Including custom data fields, allowing you to create keys as needed.
  • Note: If both custom data and custom JSON are provided, priority will be given to the custom JSON data.
  • Once all the necessary information has been provided, please click on the "Save and Send Test Request" button.
1730533175134.png



2. Update Record:

Please follow below the step to capture the action response to the above-mentioned action event -

  • Use Case: To update a record within the collection in MongoDB.
  • Select the "Update Record" action, and connect your MongoDB account.
  • Provide Collection name same as you have provided within the MongoDB cluster.
  • Provide all required details, including any custom Data you'd like to update within the database.
  • Once all the necessary information has been provided, please click on the "Save and Send Test Request" button.

1730534166579.png


3. Retrive a Record by ID:

Please follow below the step to capture the action response to the above-mentioned action event -

  • Use Case: To create a record within the collection in MongoDB.
  • Select the "Retrieve a Record by ID" action and connect your MongoDB account.
  • Make sure to provide all required details, including the correct record ID and the collection name exactly as it appears in MongoDB.
  • Once all the necessary information has been provided, please click on the "Save and Send Test Request" button.
1730534351057.png


Successful Integration:

Upon completing the above steps, your TradeIndia account will now be successfully integrated with Pabbly Connect. You can utilize trigger events according to your purpose. With this integration, you can automate processes through Pabbly Connect, improving your workflow and enhancing your productivity.

If you encounter any issues or require further assistance, feel free to reach out to our support team for help. ([email protected])

Happy integrating!
 

Attachments

  • 1730531209027.png
    1730531209027.png
    22.8 KB · Views: 15
Last edited:
Status
Not open for further replies.
Top