kurt213 / mongodb-to-postgresql Goto Github PK
View Code? Open in Web Editor NEWMigrate and replicate data from MongoDB to PostgreSQL in Node.js
License: Mozilla Public License 2.0
Migrate and replicate data from MongoDB to PostgreSQL in Node.js
License: Mozilla Public License 2.0
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
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]
To being updated?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.