MongoDB Puller
The MongoDB Puller component retrieves data from MongoDB databases efficiently and flexibly.
Configuration
Mongo URI
Provide the MongoDB URI that includes the database name for a successful connection.
The MongoDB URI is a connection string that specifies the client, server, and authentication details required to connect to a MongoDB database. Below is a breakdown of the common MongoDB URI syntax elements and their meanings:
Standard URI Format:
mongodb+srv://[username]:[password]@[host]/[database]?retryWrites=true&w=majority
Components Explained:
-
mongodb+srv://
- The protocol used;srv
indicates that this is a connection string for MongoDB with DNS Seedlist Connection Format. -
[username]
- The username for database authentication. -
[password]
- The corresponding password for the username. -
[host]
- The hostname or IP address of the MongoDB server. -
[database]
- The specific database name to connect to within the MongoDB server. If the database doesn't exist, MongoDB creates it upon the first data insertion.
Optional Parameters:
-
retryWrites=true
- An option for automatic retry of write operations if they fail initially. -
w=majority
- A write concern setting that waits for the write operation to be acknowledged by the majority of hosts in a replica set.
Example URI:
mongodb+srv://johndoe:secret123@cluster0.example.mongodb.net/myDatabase?retryWrites=true&w=majority
Collection
After inputting the URI, use the Test Connection
button to establish a connection. Once the connection is successful, you will have the option to select a collection from the dropdown menu.
Select Query Type
Choose between two types of queries:
- Query Filter: For straightforward querying with conditions.
- Aggregation Query (Shell): For complex data manipulation using MongoDB's aggregation framework.
Testing and Saving Configuration
After configuring your query, use the Test Run
buttons to preview the result. Once satisfied with the configuration, save it to apply the settings during pipeline executions.