NoSQL , document-oriented database that supports JSON-like documents with a dynamic schema.Overview‚ÄãThe MongoDB Document Loader returns a list of Langchain Documents from a MongoDB database.The Loader requires the following parameters:MongoDB connection stringMongoDB database nameMongoDB collection name(Optional) Content Filter dictionaryThe output takes the following format:pageContent= Mongo Documentmetadata={'database': '[database_name]', 'collection': '[collection_name]'}Load the Document Loader‚Äã# add this import for running in jupyter notebookimport nest_asyncionest_asyncio.apply()from langchain.document_loaders.mongodb import MongodbLoaderloader = MongodbLoader(connection_string="mongodb://localhost:27017/",                       db_name="sample_restaurants",                        collection_name="restaurants",                       filter_criteria={"borough": "Bronx", "cuisine": "Bakery" },                       )docs = loader.load()len(docs)    25359docs[0]    Document(page_content="{'_id': ObjectId('5eb3d668b31de5d588f4292a'), 'address': {'building': '2780', 'coord': [-73.98241999999999, 40.579505], 'street': 'Stillwell Avenue', 'zipcode': '11224'}, 'borough': 'Brooklyn', 'cuisine': 'American', 'grades': [{'date': datetime.datetime(2014, 6, 10, 0, 0), 'grade': 'A', 'score': 5}, {'date': datetime.datetime(2013, 6, 5, 0, 0), 'grade': 'A', 'score': 7}, {'date': datetime.datetime(2012, 4, 13, 0, 0), 'grade': 'A', 'score': 12}, {'date': datetime.datetime(2011, 10, 12, 0, 0), 'grade': 'A', 'score': 12}], 'name': 'Riviera Caterer', 'restaurant_id': '40356018'}", metadata={'database': 'sample_restaurants', 'collection': 'restaurants'})PreviousModern TreasuryNextNews URLOverviewLoad the Document LoaderCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
MongoDB is a NoSQL , document-oriented database that supports JSON-like documents with a dynamic schema.
MongoDB is a NoSQL , document-oriented database that supports JSON-like documents with a dynamic schema. ->: NoSQL , document-oriented database that supports JSON-like documents with a dynamic schema.Overview‚ÄãThe MongoDB Document Loader returns a list of Langchain Documents from a MongoDB database.The Loader requires the following parameters:MongoDB connection stringMongoDB database nameMongoDB collection name(Optional) Content Filter dictionaryThe output takes the following format:pageContent= Mongo Documentmetadata={'database': '[database_name]', 'collection': '[collection_name]'}Load the Document Loader‚Äã# add this import for running in jupyter notebookimport nest_asyncionest_asyncio.apply()from langchain.document_loaders.mongodb import MongodbLoaderloader = MongodbLoader(connection_string="mongodb://localhost:27017/",                       db_name="sample_restaurants",                        collection_name="restaurants",                       filter_criteria={"borough": "Bronx", "cuisine": "Bakery" },                       )docs = loader.load()len(docs)    25359docs[0]    Document(page_content="{'_id': ObjectId('5eb3d668b31de5d588f4292a'), 'address': {'building': '2780', 'coord': [-73.98241999999999, 40.579505], 'street': 'Stillwell Avenue', 'zipcode': '11224'}, 'borough': 'Brooklyn', 'cuisine': 'American', 'grades': [{'date': datetime.datetime(2014, 6, 10, 0, 0), 'grade': 'A', 'score': 5}, {'date': datetime.datetime(2013, 6, 5, 0, 0), 'grade': 'A', 'score': 7}, {'date': datetime.datetime(2012, 4, 13, 0, 0), 'grade': 'A', 'score': 12}, {'date': datetime.datetime(2011, 10, 12, 0, 0), 'grade': 'A', 'score': 12}], 'name': 'Riviera Caterer', 'restaurant_id': '40356018'}", metadata={'database': 'sample_restaurants', 'collection': 'restaurants'})PreviousModern TreasuryNextNews URLOverviewLoad the Document LoaderCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.