AmeliaCcc opened a new issue, #9099:
URL: https://github.com/apache/seatunnel/issues/9099

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   When using mongodb-cdc to write data to MongoDB, the _id field that was 
originally in ObjectId format gets converted to string format.
   
   ### SeaTunnel Version
   
   2.3.10
   
   ### SeaTunnel Config
   
   ```conf
   env {
     # You can set engine configuration here
     parallelism = 1
     job.mode = "STREAMING"
     checkpoint.interval = 5000
   }
   
   source {
     MongoDB-CDC {
   
       plugin_output = "source_data"
       hosts = "*.*.*.*:27017"
       connection.options = "replicaSet=mdb&authSource=admin"
       database = ["database"]
       collection = [
         "database.collection"
       ]
       username = "user"
       password = "pwd"
   
       schema = {
         table = "database.collection"
         fields {
           _id = string
           storeId = bigint
           labels = string
         }
       }
     }
   }
   
   sink {
     console {
       plugin_input = ["source_data"]
     }
     MongoDB {
       plugin_input = ["source_data"]
       uri = "mongodb://user:password@*.*.*.*:27017/test"
       database = "test"
       collection = "collection"
       primary-key = ["_id"]
       upsert-enable = true
     }
   }
   ```
   
   ### Running Command
   
   ```shell
   ./bin/seatunnel.sh --config ./job/xxx.conf  -m local
   ```
   
   ### Error Exception
   
   ```log
   No exception
   ```
   
   ### Zeta or Flink or Spark Version
   
   Zeta
   
   ### Java or Scala Version
   
   Jdk17
   
   ### Screenshots
   
   <img width="470" alt="Image" 
src="https://github.com/user-attachments/assets/a7413f85-9d57-4a18-aff9-6430a8c237c1";
 />
   
   <img width="466" alt="Image" 
src="https://github.com/user-attachments/assets/9b5bad1b-2379-491a-ace6-b5af1c911ea7";
 />
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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