davidzollo commented on code in PR #8728:
URL: https://github.com/apache/seatunnel/pull/8728#discussion_r1969858532


##########
docs/zh/connector-v2/sink/MongoDB.md:
##########
@@ -0,0 +1,235 @@
+# MongoDB
+
+> MongoDB数据接收器
+
+## 支持引擎
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## 主要特性
+
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [cdc](../../concept/connector-v2-features.md)
+
+**提示**
+
+> 1.如果要使用CDC写入的功能,建议启用 upsert-enable 配置。
+
+## 描述
+
+MongoDB连接器提供了从MongoDB读取数据和向MongoDB写入数据的能力。
+本文档描述了如何设置MongoDB连接器以针对MongoDB运行数据写入器。
+
+## 支持的数据源信息
+
+为了使用Mongodb连接器,需要以下依赖关系。
+它们可以通过install-plugin.sh或Maven中央存储库下载。
+
+| 数据来源 | 支持的版本 | 依赖                                                            
                |
+|------------|--------------------|---------------------------------------------------------------------------------------|
+| MongoDB    | universal          | 
[Download](https://mvnrepository.com/artifact/org.apache.seatunnel/connector-mongodb)
 |
+
+## 数据类型映射
+
+下表列出了从MongoDB BSON类型到Seatunnel数据类型的字段数据类型映射。
+
+| Seatunnel数据类型 | MongoDB BSON类型 |
+|---------------------|-------------------|
+| STRING              | ObjectId          |
+| STRING              | String            |
+| BOOLEAN             | Boolean           |
+| BINARY              | Binary            |
+| INTEGER             | Int32             |
+| TINYINT             | Int32             |
+| SMALLINT            | Int32             |
+| BIGINT              | Int64             |
+| DOUBLE              | Double            |
+| FLOAT               | Double            |
+| DECIMAL             | Decimal128        |
+| Date                | Date              |
+| Timestamp           | Timestamp[Date]   |
+| ROW                 | Object            |
+| ARRAY               | Array             |
+
+**提示**
+
+> 
1.当使用SeaTunnel将Date和Timestamp类型写入MongoDB时,两者都会在MongoDB中生成Date数据类型,但精度会有所不同。SeaTunnel
 Date类型生成的数据具有二级精度,而SeaTunnel Timestamp类型生成的数字具有毫秒级精度。<br/>
+> 2.在SeaTunnel中使用DECIMAL类型时,请注意最大范围不能超过34位数字,这意味着您应该使用DECIMAL(34,18)。<br/>
+
+## Sink 选项
+
+|         名称          |   类型   | 是否必传 | 默认值 |                                  
                       描述                                                       
   |
+|-----------------------|----------|----------|---------|------------------------------------------------------------------------------------------------------------------------------|
+| uri                   | String   | 是      | -       | 
MongoDB标准连接uri。例如。mongodb://user:password@hosts:27017/database?readPreference=secondary&slaveOk=true.
 |
+| database              | String   | 是      | -       | 要读取或写入的MongoDB数据库的名称.  
                                                                             |
+| collection            | String   | 是      | -       | 要读取或写入的MongoDB集合的名称.   
                                                                          |
+| schema                | String   | 是      | -       | 
MongoDB的BSON和seatunnel数据结构映射.                                                   
                      |
+| buffer-flush.max-rows | String   | 否       | 1000    | 指定每个批处理请求的最大缓冲行数.     
                                                        |
+| buffer-flush.interval | String   | 否       | 30000   | 
指定每个批处理请求的最大缓冲行间隔,单位为毫秒.                                  |
+| retry.max             | String   | 否       | 3       | 指定向数据库写入记录失败时的最大重试次数. 
                                                    |
+| retry.interval        | Duration | 否       | 1000    | 
指定向数据库写入记录失败时的重试时间间隔,单位为毫秒.                            |
+| upsert-enable         | Boolean  | 否       | 否   | 是否通过追加销售模式编写文档.           
                                                                       |

Review Comment:
   | upsert-enable | Boolean | 否 | false | 是否开启 upsert.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to