From f61b8577207aeb7e328e344fbeb848151695b39f Mon Sep 17 00:00:00 2001 From: Nedumaran Date: Mon, 19 Feb 2024 23:15:03 +0530 Subject: [PATCH] Revert "mongodb performance improvement. Making index_creation as optional" This reverts commit 847b2a7c37bcb9fa5a4f18c3f329bd9318013424. --- .../langchain_community/chat_message_histories/mongodb.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/community/langchain_community/chat_message_histories/mongodb.py b/libs/community/langchain_community/chat_message_histories/mongodb.py index 660002d0abf38..5865f86b13c00 100644 --- a/libs/community/langchain_community/chat_message_histories/mongodb.py +++ b/libs/community/langchain_community/chat_message_histories/mongodb.py @@ -32,7 +32,6 @@ def __init__( session_id: str, database_name: str = DEFAULT_DBNAME, collection_name: str = DEFAULT_COLLECTION_NAME, - index_creation:bool =True ): from pymongo import MongoClient, errors @@ -48,8 +47,7 @@ def __init__( self.db = self.client[database_name] self.collection = self.db[collection_name] - if index_creation: #Conditional Index Creation for collection - self.collection.create_index("SessionId") + self.collection.create_index("SessionId") @property def messages(self) -> List[BaseMessage]: # type: ignore