MongoDBStructuredQueryTranslator#
- class langchain_mongodb.retrievers.self_querying.MongoDBStructuredQueryTranslator[source]#
Translator between MongoDB Query API and LangChainβs StructuredQuery.
With Vector Search Indexes, one can index boolean, date, number, objectId, string, and UUID fields to pre-filter your data. Filtering your data is useful to narrow the scope of your semantic search and ensure that not all vectors are considered for comparison. It reduces the number of documents against which to run similarity comparisons, which can decrease query latency and increase the accuracy of search results.
Methods
visit_comparison
(comparison)Translate a Comparison.
visit_operation
(operation)Translate an Operation.
visit_structured_query
(structured_query)Translate a StructuredQuery.
- visit_comparison(comparison: Comparison) Dict [source]#
Translate a Comparison.
- Parameters:
comparison (Comparison) β Comparison to translate.
- Return type:
Dict