File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
libs/langchain-mongodb/tests/integration_tests Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -46,16 +46,16 @@ def setup_test(coll: Collection) -> MongoDBAtlasVectorSearch:
4646 text_key = PAGE_CONTENT_FIELD ,
4747 auto_index_timeout = TIMEOUT ,
4848 )
49- coll . delete_many ({})
50-
51- vs .add_documents (
52- [
53- Document (page_content = "In 2023, I visited Paris" ),
54- Document (page_content = "In 2022, I visited New York" ),
55- Document (page_content = "In 2021, I visited New Orleans" ),
56- Document (page_content = "Sandwiches are beautiful. Sandwiches are fine." ),
57- ]
58- )
49+
50+ if coll . count_documents ({}) == 0 :
51+ vs .add_documents (
52+ [
53+ Document (page_content = "In 2023, I visited Paris" ),
54+ Document (page_content = "In 2022, I visited New York" ),
55+ Document (page_content = "In 2021, I visited New Orleans" ),
56+ Document (page_content = "Sandwiches are beautiful. Sandwiches are fine." ),
57+ ]
58+ )
5959
6060 # Set up the search index if needed.
6161 if not any ([ix ["name" ] == SEARCH_INDEX_NAME for ix in coll .list_search_indexes ()]):
You can’t perform that action at this time.
0 commit comments