Note: Part of the content refers to HTTP://BLOG.SINA.COM.CN/S/BLOG_4AC9F56E0101G881.HTML1, MongoDB data to MYSQL1) in kettle, MongoDB input component.
2) Edit component input Connection information
Select Database
Write query statements
Select a field. The check box above selects whether to enter the JSON format, which is not selected. Click Get Fileds to get the field correspondence. $ represents the root directory. Representing subdirectories[] represents the values in the array, for example:
{"data" :{
"museum":[
{
"country":"italy",
"city": "Vencie",
"id_museum":"109",
"name":"pa"},
{
"country":"Mexico",
"city": "Mexico city",
"id_museum":"36",
"name":"Musre"}
]
}
}
$..city表明元素city是在根节点下data节点内的museum节点内。
$.data.museum[1].city表明指定的元素,即上述museum数组第二个节点的city值
previewing data
3) Table Output Select the output-table output component. Connect the MongoDB input component and the table output component.
Edit Table Output
4) Perform the conversion
Ii. MySQL Data migration to MONGODB1) Select the table input component and edit the table input
2) Select the "Bigdata-mongodb ouput" component to connect the two components. Edit the MongoDB output component
Enter connection information
Input data data and collections (no collection is created automatically)
Click Get field
3) Perform the conversion
From for notes (Wiz)
KETTLE:MONGDB and MySQL data transfer