MongoDB

This page describes how to create a connection to MongoDB using a SQL command.

To ingest data from MongoDB using Upsolver, you must first create a connection with the appropriate credentials to access your database.

See the Connection String URI Format MongoDB documentation for further information.

Syntax

CREATE MONGODB CONNECTION <connection_identifier> 
    CONNECTION_STRING = '<connection_string>' 
    USER_NAME = 'your username'
    PASSWORD = 'your password' 
    [ TIMEOUT = INTERVAL '<integer>' SECONDS ]
    [ COMMENT = '<comment>' ]

Jump to

Connection options

CONNECTION_STRING — editable

Type: text

The connection string to use when connecting to the server.

USER_NAME — editable

Type: text

The user to authenticate to the database with.

PASSWORD — editable

Type: text

The password for the user.

TIMEOUT

Value: INTERVAL '<integer>' SECONDS

Default: 30 SECONDS

(Optional) Timeout will override the timeout setting specified in the connection string.

COMMENT — editable

Type: text

(Optional) A description or comment regarding this connection.

Example

CREATE MONGODB CONNECTION my_mongodb_connection
    CONNECTION_STRING = 'mongodb+srv://upsolver.example.mongodb.net/testdb'
    USER_NAME = 'your_username'
    PASSWORD = 'your_password'
    TIMEOUT = INTERVAL '10' SECONDS
    COMMENT = 'Connection to MongoDB';

Last updated