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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c099a228117a4515b7b655c43aba32b389874d7cdff69020ab9d4d02474c10d |
|
MD5 | 662a12ac5d943db4971e98149374b5f1 |
|
BLAKE2b-256 | 74680b68a294f0ef1090aed21d8e611318824e59cfe1e3bbe1784afbc274ac40 |
Close
Hashes for llama_index_readers_mongodb-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3a32906144932f5f5a2b92154f7573c4c77255a62ca99079bf67ee4c334dc3f |
|
MD5 | 4d0e76fb558b5df1c9b2199dea946402 |
|
BLAKE2b-256 | 262789e5bbaac66df58c08879cc99c7b62e55e7ec078a1a00be022d08136e65f |