Carl-Zhou-CN commented on code in PR #9883:
URL: https://github.com/apache/seatunnel/pull/9883#discussion_r2425113789


##########
seatunnel-connectors-v2/connector-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/mongodb/config/MongodbConfig.java:
##########
@@ -153,4 +159,12 @@ public class MongodbConfig {
 
     public static final Option<Boolean> TRANSACTION =
             
Options.key("transaction").booleanType().defaultValue(false).withDescription(".");
+
+    public static final Option<DataSaveMode> DATA_SAVE_MODE =
+            Options.key("data_save_mode")
+                    .singleChoice(
+                            DataSaveMode.class,
+                            Arrays.asList(DROP_DATA, APPEND_DATA, 
ERROR_WHEN_DATA_EXISTS))
+                    .defaultValue(APPEND_DATA)
+                    .withDescription("data_save_mode");

Review Comment:
   Add a description of him instead of copying the name



##########
docs/en/connector-v2/sink/MongoDB.md:
##########
@@ -62,19 +62,28 @@ The following table lists the field data type mapping from 
MongoDB BSON type to
 
 ## Sink Options
 
-|         Name          |   Type   | Required | Default |                      
                                   Description                                  
                        |
-|-----------------------|----------|----------|---------|------------------------------------------------------------------------------------------------------------------------------|
-| uri                   | String   | Yes      | -       | The MongoDB standard 
connection uri. eg. 
mongodb://user:password@hosts:27017/database?readPreference=secondary&slaveOk=true.
 |
-| database              | String   | Yes      | -       | The name of MongoDB 
database to read or write.                                                      
                         |
-| collection            | String   | Yes      | -       | The name of MongoDB 
collection to read or write.                                                    
                         |
-| buffer-flush.max-rows | String   | No       | 1000    | Specifies the 
maximum number of buffered rows per batch request.                              
                               |
-| buffer-flush.interval | String   | No       | 30000   | Specifies the 
maximum interval of buffered rows per batch request, the unit is millisecond.   
                               |
-| retry.max             | String   | No       | 3       | Specifies the max 
number of retry if writing records to database failed.                          
                           |
-| retry.interval        | Duration | No       | 1000    | Specifies the retry 
time interval if writing records to database failed, the unit is millisecond.   
                         |
-| upsert-enable         | Boolean  | No       | false   | Whether to write 
documents via upsert mode.                                                      
                            |
-| primary-key           | List     | No       | -       | The primary keys for 
upsert/update. Keys are in `["id","name",...]` format for properties.           
                        |
-| transaction           | Boolean  | No       | false   | Whether to use 
transactions in MongoSink (requires MongoDB 4.2+).                              
                              |
-| common-options        |          | No       | -       | Source plugin common 
parameters, please refer to [Source Common Options](../sink-common-options.md) 
for details              |
+| Name                  | Type     | Required | Default | Description          
                                                                                
                        |
+|-----------------------|----------|----------|--------|------------------------------------------------------------------------------------------------------------------------------|
+| uri                   | String   | Yes      | -      | The MongoDB standard 
connection uri. eg. 
mongodb://user:password@hosts:27017/database?readPreference=secondary&slaveOk=true.
 |
+| database              | String   | Yes      | -      | The name of MongoDB 
database to read or write.                                                      
                         |
+| collection            | String   | Yes      | -      | The name of MongoDB 
collection to read or write.                                                    
                         |
+| buffer-flush.max-rows | String   | No       | 1000   | Specifies the maximum 
number of buffered rows per batch request.                                      
                       |
+| buffer-flush.interval | String   | No       | 30000  | Specifies the maximum 
interval of buffered rows per batch request, the unit is millisecond.           
                       |
+| retry.max             | String   | No       | 3      | Specifies the max 
number of retry if writing records to database failed.                          
                           |
+| retry.interval        | Duration | No       | 1000   | Specifies the retry 
time interval if writing records to database failed, the unit is millisecond.   
                         |
+| upsert-enable         | Boolean  | No       | false  | Whether to write 
documents via upsert mode.                                                      
                            |
+| primary-key           | List     | No       | -      | The primary keys for 
upsert/update. Keys are in `["id","name",...]` format for properties.           
                        |
+| transaction           | Boolean  | No       | false  | Whether to use 
transactions in MongoSink (requires MongoDB 4.2+).                              
                              |
+| common-options        |          | No       | -      | Source plugin common 
parameters, please refer to [Source Common Options](../sink-common-options.md) 
for details              |
+| data_save_mode        | String   | No       | APPEND_DATA       | The data 
saving mode of mongodb                                                      |
+
+### data_save_mode [Enum]

Review Comment:
   Describing him in the "Description" section of the table would be more in 
line with the previous format



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to