MongoDB Vector Store misaligned strings and classes (#3064)

This commit is contained in:
Kade Shockey
2025-06-30 23:42:28 -06:00
committed by GitHub
parent 5a1083b709
commit b79bfb7c1e
4 changed files with 14 additions and 37 deletions

View File

@@ -1,7 +1,6 @@
import time
import pytest
from unittest.mock import MagicMock, patch
from mem0.vector_stores.mongodb import MongoVector
from mem0.vector_stores.mongodb import MongoDB
from pymongo.operations import SearchIndexModel
@pytest.fixture
@@ -16,12 +15,11 @@ def mongo_vector_fixture(mock_mongo_client):
mock_collection.find.return_value = []
mock_db.list_collection_names.return_value = []
mongo_vector = MongoVector(
mongo_vector = MongoDB(
db_name="test_db",
collection_name="test_collection",
embedding_model_dims=1536,
user="username",
password="password",
mongo_uri="mongodb://username:password@localhost:27017"
)
return mongo_vector, mock_collection, mock_db
@@ -48,7 +46,7 @@ def test_initalize_create_col(mongo_vector_fixture):
"fields": {
"embedding": {
"type": "knnVector",
"d": 1536,
"dimensions": 1536,
"similarity": "cosine",
}
}