mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 06:23:20 +00:00
removing client+namespace in favor of collection (#5610)
removing client+namespace in favor of collection for an easier instantiation and to be similar to the typescript library @dev2049
This commit is contained in:
committed by
GitHub
parent
ad09367a92
commit
92f218207b
@@ -118,15 +118,14 @@
|
||||
"\n",
|
||||
"db_name = \"lanchain_db\"\n",
|
||||
"collection_name = \"langchain_col\"\n",
|
||||
"namespace = f\"{db_name}.{collection_name}\"\n",
|
||||
"collection = client[db_name][collection_name]\n",
|
||||
"index_name = \"langchain_demo\"\n",
|
||||
"\n",
|
||||
"# insert the documents in MongoDB Atlas with their embedding\n",
|
||||
"docsearch = MongoDBAtlasVectorSearch.from_documents(\n",
|
||||
" docs,\n",
|
||||
" embeddings,\n",
|
||||
" client=client,\n",
|
||||
" namespace=namespace,\n",
|
||||
" collection=collection,\n",
|
||||
" index_name=index_name\n",
|
||||
")\n",
|
||||
"\n",
|
||||
|
Reference in New Issue
Block a user