Creating a Connection

Requirements for MongoDB Connection

To establish a MongoDB connection, you will need:

  • The MongoDB URI which provides the full connection string to access your database.

  • Database name to specify which MongoDB database the connection should interact with.

Creating a Connection

Here’s how you can create a MongoDB connection in PigeonsAI:

res = client.data_connector.create_connector(
    connection_name="demo_mongodb_conn",
    connection_type="mongodb",
    mongodb_uri='mongodb+srv://testusername:testpassword@test-cluster0.ghgwsy.mongodb.net/?retryWrites=true&w=majority&appName=test-Cluster0',
    db_name='training',
)

Example Output

 Connector creation successful: 201 Created
 Data connector URI: uri:data-connector:biraj_pigeonsai.com:3d2c0a99-83cd-4bf5-9094-d198bde6f9bb

The output URI from the connection will be used to create a train dataset below.

Security Best Practices

Connection Security

Ensure your MongoDB URI includes credentials (username and password) that are specific to a user with the appropriate level of access. It's recommended to use a user with read-only permissions to enhance security.

Data Access

Similar to the PostgreSQL connector, when data is pulled via the MongoDB connector, PigeonsAI accesses only the specified fields in the database. No other data is accessed or transferred, which aligns with data privacy and minimization principles.

IP Address Whitelisting

If your MongoDB instance requires whitelisting of IP addresses for connections, please reach out via the provided scheduling link. PigeonsAI will provide the necessary IP addresses to facilitate a secure connection setup.

Data pulling your cloud/vpc

For businesses requiring integrations within their own cloud environments or needing specific security configurations, PigeonsAI is equipped to handle customized setups. Contact us through the demo link to explore bespoke solutions tailored to your organizational needs.

Last updated