MongoDB 凭证#
¥MongoDB credentials
你可以使用以下凭据验证以下节点:
¥You can use these credentials to authenticate the following nodes:
先决条件#
¥Prerequisites
- 在 MongoDB 服务器上创建具有相应权限的用户账户。
¥Create a user account with the appropriate permissions on a MongoDB server.
- 作为项目所有者,请将所有 n8n IP 地址 添加到项目网络访问的 IP 访问列表条目中。有关详细说明,请联系 添加 IP 访问列表条目。
¥As a Project Owner, add all the n8n IP addresses to the IP Access List Entries in the project's Network Access. Refer to Add IP Access List entries for detailed instructions.
如果你从头开始设置 MongoDB,请创建一个集群和一个数据库。请参阅 MongoDB Atlas 文档,了解更多步骤说明。
¥If you are setting up MongoDB from scratch, create a cluster and a database. Refer to the MongoDB Atlas documentation for more detailed instructions on these steps.
支持的身份验证方法#
¥Supported authentication methods
- 数据库连接 - 连接字符串
¥Database connection - Connection string
- 数据库连接 - 值
¥Database connection - Values
相关资源#
¥Related resources
请参阅 MongoDB Atlas 文档,了解更多关于服务的信息。
¥Refer to the MongoDBs Atlas documentation for more information about the service.
使用数据库连接 - 连接字符串#
¥Using database connection - Connection string
要配置此凭据,你需要上面列出的 先决条件 实例。然后:
¥To configure this credential, you'll need the Prerequisites listed above. Then:
- 选择“连接字符串”作为配置类型。
¥Select Connection String as the Configuration Type. 2. 请输入你的 MongoDB 连接字符串。获取 MongoDB 中的连接字符串,请转到“数据库”>“连接”。
¥Enter your MongoDB Connection String. To get your connection string in MongoDB, go to Database > Connect. 1. 选择“驱动程序”。
1 | |
-
将你在“添加连接字符串”中看到的代码复制到你的应用代码中。它将类似于:
mongodb+srv://yourName:yourPassword@clusterName.mongodb.net/?retryWrites=true&w=majority。¥Copy the code you see in Add your connection string into your application code. It will be something like:
mongodb+srv://yourName:yourPassword@clusterName.mongodb.net/?retryWrites=true&w=majority. 3. 将连接字符串中的<password>和<username>替换为你将使用的数据库用户凭据。¥Replace the
<password>and<username>in the connection string with the database user's credentials you'll be using. 4. 在 n8n 中输入该连接字符串。¥Enter that connection string into n8n. 5. 请参阅 连接字符串 以了解如何查找和格式化连接字符串。
¥Refer to Connection String for information on finding and formatting your connection string. 3. 请输入你的数据库名称。这是你添加到连接字符串中的用户正在登录的数据库名称。
¥Enter your Database name. This is the name of the database that the user whose details you added to the connection string is logging into. 4. 选择是否使用 TLS:启用此选项以使用 TLS。你的 MongoDB 数据库必须配置为使用 TLS,并已生成 x.509 证书。在 n8n 中添加以下证书字段的信息:
¥Select whether to Use TLS: Turn on to use TLS. You must have your MongoDB database configured to use TLS and have an x.509 certificate generated. Add information for these certificate fields in n8n:
-
CA 证书
¥CA Certificate
-
公开客户端证书
¥Public Client Certificate
-
私钥客户端
¥Private Client Key
-
密码短语
¥Passphrase
有关使用 x.509 证书的更多信息,请参阅 MongoDB x.509 文档。
¥Refer to MongoDB's x.509 documentation for more information on working with x.509 certificates.
使用数据库连接 - 值#
¥Using database connection - Values
要配置此凭据,你需要上面列出的 先决条件 实例。然后:
¥To configure this credential, you'll need the Prerequisites listed above. Then:
- 选择“值”作为配置类型。
¥Select Values as the Configuration Type. 2. 输入数据库主机名或地址。
¥Enter the database Host name or address. 3. 输入数据库名称。
¥Enter the Database name. 4. 输入你要登录的用户。
¥Enter the User you'd like to log in as. 5. 请输入用户密码。
¥Enter the user's Password. 6. 输入用于连接的端口。这是服务器用于监听传入连接的端口号。
¥Enter the Port to connect over. This is the port number your server uses to listen for incoming connections. 7. 选择是否使用 TLS:启用此选项以使用 TLS。你的 MongoDB 数据库必须配置为使用 TLS,并已生成 x.509 证书。在 n8n 中添加以下证书字段的信息:
¥Select whether to Use TLS: Turn on to use TLS. You must have your MongoDB database configured to use TLS and have an x.509 certificate generated. Add information for these certificate fields in n8n:
-
CA 证书
¥CA Certificate
-
公开客户端证书
¥Public Client Certificate
-
私钥客户端
¥Private Client Key
-
密码短语
¥Passphrase
有关使用 x.509 证书的更多信息,请参阅 MongoDB x.509 文档。
¥Refer to MongoDB's x.509 documentation for more information on working with x.509 certificates.