mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 06:39:52 +00:00
community[patch]: documented the feature to filter documents in MongoDBloader (#18842)
"community[docs]: documented the feature to filter documents in MongoDBloader" - Description: documented the feature to filter documents in MongoDBloader - Feature: the feature https://github.com/langchain-ai/langchain/discussions/18251 - Dependencies: No - Twitter handle: https://twitter.com/im_Kushagra
This commit is contained in:
parent
c3580d3c64
commit
5fcbe9dd2a
@ -42,6 +42,7 @@
|
|||||||
"* MongoDB database name\n",
|
"* MongoDB database name\n",
|
||||||
"* MongoDB collection name\n",
|
"* MongoDB collection name\n",
|
||||||
"* (Optional) Content Filter dictionary\n",
|
"* (Optional) Content Filter dictionary\n",
|
||||||
|
"* (Optional) List of field names to include in the output\n",
|
||||||
"\n",
|
"\n",
|
||||||
"The output takes the following format:\n",
|
"The output takes the following format:\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -59,7 +60,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 24,
|
"execution_count": 2,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@ -71,7 +72,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 6,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@ -80,7 +81,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 25,
|
"execution_count": 11,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@ -89,21 +90,22 @@
|
|||||||
" db_name=\"sample_restaurants\",\n",
|
" db_name=\"sample_restaurants\",\n",
|
||||||
" collection_name=\"restaurants\",\n",
|
" collection_name=\"restaurants\",\n",
|
||||||
" filter_criteria={\"borough\": \"Bronx\", \"cuisine\": \"Bakery\"},\n",
|
" filter_criteria={\"borough\": \"Bronx\", \"cuisine\": \"Bakery\"},\n",
|
||||||
|
" field_names=[\"name\", \"address\"],\n",
|
||||||
")"
|
")"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 26,
|
"execution_count": 12,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"25359"
|
"71"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 26,
|
"execution_count": 12,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"output_type": "execute_result"
|
"output_type": "execute_result"
|
||||||
}
|
}
|
||||||
@ -116,16 +118,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 27,
|
"execution_count": 13,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"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'})"
|
"Document(page_content=\"Morris Park Bake Shop {'building': '1007', 'coord': [-73.856077, 40.848447], 'street': 'Morris Park Ave', 'zipcode': '10462'}\", metadata={'database': 'sample_restaurants', 'collection': 'restaurants'})"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 27,
|
"execution_count": 13,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"output_type": "execute_result"
|
"output_type": "execute_result"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user