1、datax脚本
{
"job": {
"setting": {
"speed": {
"channel": 2
}
},
"content": [{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "root",
"password": "123456",
"column": ["*"],
"connection": [{
"table": [
"dm_mysql"
],
"jdbcUrl": [
"jdbc:mysql://ip:3306/test"
]
}]
}
},
"writer": {
"name": "mongodbwriter",
"parameter": {
"address": [
"ip:port"
],
"userName": "admin",
"userPassword": "123456",
"dbName": "bdcp",
"collectionName": "dm",
"column": [{
"name": "id",
"type": "int"
},
{
"name": "name",
"type": "string"
},
{
"name": "price",
"type": "double"
},
{
"name": "t_char",
"type": "string"
},
{
"name": "t_date",
"type": "date"
},
{
"name": "t_time",
"type": "date"
},
{
"name": "t_datetime",
"type": "date"
},
{
"name": "t_number",
"type": "double"
},
{
"name": "t_text",
"type": "string"
}
],
"writeMode": {
"isReplace": "true",
"replaceKey": "id"
}
}
}
}]
}
}
|