Skip to main content

LlamaIndex Readers Integration: Mongo

Overview

Simple Mongo Reader allows loading data from a MongoDB database. It concatenates specified fields from each document into a single document used by LlamaIndex.

Installation

You can install MongoDB Reader via pip:

pip install llama-index-readers-mongodb

Usage

from llama_index.readers.mongodb import SimpleMongoReader

# Initialize SimpleMongoReader
reader = SimpleMongoReader(
    host="<Mongo Host>",  # Mongo host address
    port=27017,  # Mongo port (default: 27017)
    uri="<Mongo Connection String>",  # Provide the URI if not using host and port
)

# Lazy load data from MongoDB
documents = reader.lazy_load_data(
    db_name="<Database Name>",  # Name of the database
    collection_name="<Collection Name>",  # Name of the collection
    field_names=[
        "text"
    ],  # Names of the fields to concatenate (default: ["text"])
    separator="",  # Separator between fields (default: "")
    query_dict=None,  # Query to filter documents (default: None)
    max_docs=0,  # Maximum number of documents to load (default: 0)
    metadata_names=None,  # Names of the fields to add to metadata attribute (default: None)
)

Implementation for MongoDB reader can be found here

This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent.

Metadata

Release files for llama-index-readers-mongodb 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-readers-mongodb 0.7.0
File Size Uploaded Provenance Actions
llama_index_readers_mongodb-0.7.0.tar.gz 5.2 kB Without provenance Details for llama_index_readers_mongodb-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-readers-mongodb 0.7.0
File Interpreter ABI Platform Actions
llama_index_readers_mongodb-0.7.0-py3-none-any.whl Python 3 none any Details for llama_index_readers_mongodb-0.7.0-py3-none-any.whl

Total release size: 10.0 kB

Release files / llama_index_readers_mongodb-0.7.0.tar.gz

Download URL llama_index_readers_mongodb-0.7.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a7c2df500bac4d7af381d19f2d64104bc4bb16180deb7eb1cf4ea5300f4c9c57
BLAKE2b-256 checksum
How to use checksums
3482736fc4c7e7cac7f86b45c38d3d81fb1264175de5f814f83f49aaa0b3144e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_readers_mongodb-0.7.0-py3-none-any.whl

Download URL llama_index_readers_mongodb-0.7.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
473a88c0213345532c1f5447a2990911db05e67f38763bbccc14dbe99403b60b
BLAKE2b-256 checksum
How to use checksums
c78578dc7286d285915f9fe7c897456b7368ff9fd5557973efe286666fbe1681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-readers-mongodb 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page