Skip to main content

MongoDB

MongoDB revolutionizes data management with its innovative NoSQL approach, offering a flexible and scalable solution for modern application development.

Prerequisite

  1. Authentication Requirements: To establish a connection with your MongoDB instance, you will require specific authentication credentials. You have the choice of either of the following two credential options:

    • MongoDB database username and password.
    • Alternative authentication methods (excluding AWS IAM authentication).
  2. Connection Details:

    • Hostname of the MongoDB database.
    • Port number for database communication.
    • The designated database name within the MongoDB host.
  3. Firewall Rules:

    • Set up your firewall settings to permit DronaHQ's IP whitelist for access to your MongoDB host.

Having these essential prerequisites in place will ensure a seamless integration of MongoDB with DronaHQ, facilitating efficient data management and utilization without the need for AWS credentials.

Configuring Connector in DronaHQ

Configure your database category using the provided details. Validate connection with Test connection and Save settings for secure database setup.

tip

DronaHQ can Auto fill crucial connection values like host, name, password, and more from the connector's connection string.

General

FieldDescription
HostEnter the Host Domain or IP
PortEnter the Port number
Database NameEnter the Database name
Authentication TypeChoose from User and Password or AWS IAM
UsernameEnter the Username
PasswordEnter the Password
MongoDB with Sample details.
MongoDB with Sample details.

Admin

Advanced OptionDescription
Connection OptionsThe key and value connection options in database configuration refer to specific settings (keys) and their corresponding values that dictate how the application connects to the database
Use Latest MongoDB DriverBenefit from the latest features and improvements by using the most up-to-date MongoDB driver.
Use Dynamic Database HostDynamically determine the host for the database connection.
Use Dynamic Database NameSet the database name dynamically, allowing easy switching between databases.
Use Dynamic Database Credentials Enable dynamic database credentials for secure and convenient management.
Connect using SSL Securely access the database using an encrypted SSL connection, ensuring data integrity and confidentiality.
Enable SSH Tunneling Securely access the database through encrypted SSH tunneling.
Whitelist IP Enhance security by restricting database access to specific whitelisted IP addresses.

Adding Database Queries

After configuring the connector, access it in your Connector Library. Click Add query following the connection setup. Here's how you can create and manage queries for your MongoDB database:

  1. Name your Query: Provide a unique name for your query, which will be used for easy access.

  2. Select a Collection: Specify the MongoDB collection on which you want to perform the action. This helps direct the query to the desired data set.

  3. Choose an Action: MongoDB supports various actions, each with specific parameters. Select the appropriate action from the list provided. For example, if you select Find as the action, the available parameters will include Filter, Projection, Sort, Limit, and Skip. If you choose InsertOne, the parameters will change to Insert as Key: Value string.

  4. Set Parameters: Depending on the chosen action, input the necessary parameters. For instance, if you're performing a Find action, specify the filter conditions and other relevant details. If it's an InsertOne action, provide the data you want to insert.

ParameterDescription
FilterCriteria to match documents. Specify conditions to filter and retrieve specific data from the collection.
ProjectionFields to include/exclude from results. Define which fields should be included or excluded in the query results.
SortSorting order for results. Specify how the query results should be sorted based on one or more fields.
SkipNumber of documents to skip. Set the offset for the query results, skipping a certain number of documents.
LimitMaximum number of documents to retrieve. Set a limit on the number of documents returned by the query.
UpdateModifications to apply. Define the changes you want to make to the selected documents in the collection.
DocumentData to be inserted. Provide the document or data that you want to insert into the collection.
StagesArray of stages for aggregation pipeline. Define a series of processing stages to transform and analyze data in the collection.
FieldField for which distinct values are sought. Specify the field from which you want to find distinct values.
AggregationStages for aggregation pipeline. Define various stages such as grouping, filtering, and transformation to perform data aggregation.
  1. Run the Query: Once you've configured the action and parameters, you can execute the query by clicking Test Query The response will be displayed based on the provided parameters, allowing you to review the retrieved data or the outcome of the query.
Add query
Add query
tip

Utilize double curly brackets for incorporating dynamic variables. Prior to saving, test with sample values. Associate dynamic variables with controls/actions for real-time utilization.

Your saved queries will be visible beneath your connector within the Connector Library.

Supported Actions

ActionDescription
FindRetrieve documents from a collection based on specified criteria.
FindOneRetrieve a single document from a collection that matches a specified filter.
InsertOneInsert a single document into a collection.
InsertManyInsert multiple documents into a collection.
UpdateOneUpdate a single document in a collection that matches a specified filter.
UpdateManyUpdate multiple documents in a collection that match a specified filter.
DeleteOneDelete a single document from a collection that matches a specified filter.
DistinctFind distinct values for a specified field in a collection.
AggregatePerform aggregation operations on a collection, such as grouping, sorting, and computing aggregates.
CountCount the number of documents in a collection that match a specified filter.

Using MongoDB Connector

Follow the steps below to integrate the MongoDB Connector and execute queries:

  1. Access Data Bind Section or Control Action:

    • Navigate to the data bind section of the control
  2. Select MongoDB Connector from Data Bind Options -> Quick Select -> Database Queries

    • From the available options, choose MongoDB Connector.
    • Pick the specific connector query that will retrieve the desired data.
    • Click on "Continue" to proceed.
Insert one query
Insert one query
  1. Test and Finalize:

Once you complete these steps, you'll be able to observe the results based on the input values when running the application.