跳到主要内容

MongoDB

捆绑包 (Bundles) 包含支持特定第三方与 Langflow 集成的自定义组件。

本页面介绍了 MongoDB 捆绑包中可用的组件。

MongoDB Atlas

MongoDB Atlas 组件使用 MongoDBAtlasVectorSearch 实例对 MongoDB Atlas 向量存储进行读写操作。

关于向量存储实例

Because Langflow is based on LangChain, vector store components use an instance of LangChain vector store to drive the underlying read and write functions. These instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema.

In component code, this is often instantiated as vector_store, but some vector store components use a different name, such as the provider name.

Some LangChain classes don't expose all possible options as component parameters. Depending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow. For information about specific options, see the LangChain API reference and vector store provider's documentation.

If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of Data objects or a tabular DataFrame. If both types are supported, you can set the format near the vector store component's output port in the visual editor.

MongoDB Atlas 参数

您可以检查向量存储组件的参数,以了解更多关于它接受的输入、支持的功能以及如何配置它的信息。

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters. Conditional parameters may not be visible on the Controls pane until you set the required dependencies.

有关接受的值和功能的详细信息,请参阅 MongoDB Atlas 文档 或检查 组件代码

名称类型描述
mongodb_atlas_cluster_uriSecretString输入参数。MongoDB Atlas 集群的连接 URI。必填。
enable_mtlsBoolean输入参数。启用双向 TLS (mTLS) 身份验证。默认值:false
mongodb_atlas_client_certSecretString输入参数。用于 mTLS 身份验证的客户端证书(结合私钥)。如果启用了 mTLS,则为必填。
db_nameString输入参数。要使用的数据库名称。必填。
collection_nameString输入参数。要使用的集合名称。必填。
index_nameString输入参数。Atlas Search 索引的名称,它应该是一个向量搜索 (Vector Search) 索引。必填。
insert_modeString输入参数。如何将新文档插入集合。选项为 "append" (追加) 或 "overwrite" (覆盖)。默认值:"append"。
embeddingEmbeddings输入参数。要使用的嵌入模型。
number_of_resultsInteger输入参数。相似性搜索返回的结果数量。默认值:4。
index_fieldString输入参数。要索引的字段。默认值:"embedding"。
filter_fieldString输入参数。用于过滤索引的字段。
number_dimensionsInteger输入参数。嵌入向量的维度计数。默认值:1536。
similarityString输入参数。用于衡量向量间相似度的方法。选项为 "cosine" (余弦), "euclidean" (欧几里得) 或 "dotProduct" (点积)。默认值:"cosine"。
quantizationString输入参数。量化通过将 32 位浮点数转换为更小的数据类型来降低内存成本。选项为 "scalar" (标量) 或 "binary" (二进制)。
Search