Heyhey, another MongoDbAtlasVectorSearch question. I am currently using a weaviatevectorstore for local development and we want to use mongodb for production.
In order to work with multiple indices and Weaviate, I need to create a new WeaviateVectorStore and re-define the
index_name
whenever I am working with a different index. This is required to prevent weaviate from storing all
Nodes
under the same index name, which would cause indices to use all documents assigned to other indices, as they were all stored under the same
index_name
. This works as expected with Weaviate with little to no issues besides a bit of quirky code.
When working with MongoDBAtlas I wanted to do the same, to prevent my indices to use documents assigned to other indices. So, I am once again creating a mongodbatlasvectorsearch object, with a unique
index_name
. However, in the debug logs nor in the MongoDBAtlas collection viewer online can I see any trace of the unique
index_name
that I assigned to this vectorstore. Instead, it practically inserts a JSON representation of the Node, with
seemingly no reference to the specified
index_name
. During query time however, I do see a reference of my specified
index_name
in the debug logs, where it is apparently using said
index
to create a query pipeline.
Query debug:
DEBUG:llama_index.vector_stores.mongodb:Running query pipeline: [{'$search': {'index': 'QApp_2820b774_5218_4e20_b389_0ebdb2fc4765', 'knnBeta': {'vector': [<vector>], 'path': 'embedding', 'k': 2}}}, {'$project': {'score': {'$meta': 'searchScore'}, 'embedding': 0}}]
Document insert debug:
DEBUG:llama_index.vector_stores.mongodb:Inserting data into MongoDB: [{'id': '8e7c7e88-25d5-4f2e-ba01-de373c0c0516', 'embedding': [<vector>], 'text': <document text>, 'metadata': {<metadata>} etc. etc.