Git Product home page Git Product logo

mongodb-to-postgresql's People

Contributors

kurt213 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongodb-to-postgresql's Issues

How to make a model to take objects within objects and duplicate the lines when this occurs?

Hello! I'm new to using NodeJs and I thought your project was amazing, so I'm using it to help me.
However, I'm trying to do something that I don't understand how to execute within your project.
How can I get objects nested inside another object and the lines multiply according to the recurrence of these cases?
It's similar to a 1-to-many Inner Join.
Example:
Table A has one row with ID = X and Table B has 7 rows with ID = X and Collumn NAME = [a,b,c,d,e,f,g].
When I do the INNER JOIN the end result is a single table with 7 Rows:
ID NAME
X a
X b
X c
X d
X e
X f
X g

error: malformed array literal: "[USA]"

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]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.