llama-index readers mongodb integration
Project description
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.mongo import SimpleMongoReader
# Initialize SimpleMongoReader
reader = SimpleMongoReader(
host="<Mongo Host>", # Mongo host address
port=27017, # Mongo port (default: 27017)
)
# 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for llama_index_readers_mongodb-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 834a18bb3f13f743ae9353795a384847e113ad787b4e285eb6e249481c546d80 |
|
MD5 | 9a238d285d20015ebc94d225f9d3525e |
|
BLAKE2b-256 | af3d287faaa098f792d64b2dbb6dda7ce8314982b80e8f1ed8e41d916f2a84b4 |
Close
Hashes for llama_index_readers_mongodb-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9a291da892d0d671976b76da235c9c1b823e51bf05cf92b7d2f427dbaed6f60 |
|
MD5 | a6513573b825e5ad047d8bbd2b55af2e |
|
BLAKE2b-256 | 9e3be2b2b82f40b5cfacbd34b3a1fee7ce950f89305e77157649f2f38009ce6a |