Skip to content
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

error: malformed array literal: "[USA]" #3

Open
moleisking opened this issue Jan 4, 2022 · 0 comments
Open

error: malformed array literal: "[USA]" #3

moleisking opened this issue Jan 4, 2022 · 0 comments

Comments

@moleisking
Copy link

moleisking commented Jan 4, 2022

I am using the mongodb_sample_schema, with the following transformation and encountering the error: malformed array literal: "[USA]" when when running "node start.js migratedata".
// data_model.js movies: [ 'movies', '_id VARCHAR(50) PRIMARY KEY NOT NULL', 'plot TEXT', 'genras TEXT[]', '"cast" TEXT[]', 'title TEXT', 'year NUMERIC', 'runtime NUMERIC', 'num_mflix_comments NUMERIC', 'fullplot TEXT', 'countries TEXT[]', 'type VARCHAR(100)', 'tomatoes JSONB', 'awards JSONB', ],
I also encountered a number of other problems mainly with the package.json but after upgrading some of the packages the createdb errors disappeared.

{ "name": "mongodb-to-postgres-npm", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "async": "^3.1.0", "async-waterfall": "^0.1.5", "moment": "^2.24.0", "mongodb": "^4.2.2", "pg": "^8.7.1" } }

I think this is mostly because postgress expects the array in countries to be presented as {USA} and not [USA]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant