-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this supposed to support for array? #13
Comments
Hi @joannechan, We may have two options, I think.
The latter one would be easier to implement, but analyzing Note: MySQL has no |
To achieve the first option, we may need to allow JavaScript style configuration ( // momyfile.js could be like this...?
const config = {
"src": "mongodb://localhost:27017/dbname",
"dist": "mysql://root:password@localhost:3306/dbname",
"prefix": "t_",
"case": "camel",
"collections": {
"collection1": {
"_id": "number",
"field1": "string",
// This doesn't work at this point,
// but this type of conversion could be useful in some cases.
"field2": {
"type": "string",
"convert": val => Array.isArray(val) ? val.join('\t') : val
}
}
}
}
export default config |
@cognitom Have this support for json datatype would be hugely beneficials. Is this something that's going to be supported in the near future? I am comparing this with mosql which only support postgres. |
i strongly agree with @joannechan supporting arrays would be so much useful especially when it comes to mongoDB, its hard to find a database without arrays. But is it possible to treat the array as a collection and documents inside would be the collection documents ? since they also have an _id field |
Maybe my contribute progress #31 fit with your requirements, i had already implement feature that if some column have data type like array on json, it will be maping to new table and adding parent ID to that row, just add some relations object key on momyfile.json to make it read the mapping. cc @joannechan , @Xsmael (sorry for directly mention, just want to be helpful) PS: Sorry, if my english language so bad. |
How should I represent the array field in the json file?
The text was updated successfully, but these errors were encountered: