Connectors

Contact support

MongoDB - Getting started in Peliqan

MongoDB - Getting started in Peliqan

MongoDB is a popular open-source NoSQL database that utilizes a flexible, document-oriented data model, making it ideal for handling large volumes of unstructured data. Known for its scalability and performance, MongoDB supports modern application development with features like indexing, sharding, and real-time data processing.

This article provides an overview to get started with the MongoDB connector in Peliqan. Please contact support if you have any additional questions or remarks.

Contents

Required Schema collection in your DB

Peliqan uses Trino to connect to MongoDB and to execute SQL queries on MongoDB.

A _schema collection must be present in each database, which defines the schema.

Example record in _schema:

{
    "_id": {
        "$oid": "65b8fb86593a75d575ee835b"
    },
    "table": "my_collection",
    "fields": [
        {
            "name": "_id",
            "type": "ObjectId",
            "hidden": false
        },
        {
            "name": "name",
            "type": "varchar",
            "hidden": false
        },
        {
            "name": "age",
            "type": "bigint",
            "hidden": false
        }
    ]
}

Below is an example Python script that will add and/or update _schema in each DB. This script will perform introspection on the first 100 records of each collection to generate a _schema record:

Click here to expand script

Need further help

Please contact our support for any further assistance via support@peliqan.io.