Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashleydavis/sql-to-mongodb
A Node.js script to convert an SQL table to a MongoDB database.
https://github.com/ashleydavis/sql-to-mongodb
convert-sql-to-mongodb data database javascript mongodb mongodb-database nodejs nosql sql sql-table
Last synced: 3 months ago
JSON representation
A Node.js script to convert an SQL table to a MongoDB database.
- Host: GitHub
- URL: https://github.com/ashleydavis/sql-to-mongodb
- Owner: ashleydavis
- License: mit
- Created: 2018-01-31T05:09:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-10-02T01:23:40.000Z (over 3 years ago)
- Last Synced: 2024-09-26T17:21:29.644Z (4 months ago)
- Topics: convert-sql-to-mongodb, data, database, javascript, mongodb, mongodb-database, nodejs, nosql, sql, sql-table
- Language: JavaScript
- Size: 7.81 KB
- Stars: 39
- Watchers: 5
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sql-to-mongodb
A Node.js script to convert an SQL database to a MongoDB database.
If you like this project, please star this repo and [support my work](https://www.codecapers.com.au/about#support-my-work)
Features
- Automatically detects the primary key for each SQL table and copys it to the MongoDB _id field.
- Optionally remaps replaces and primary keys with MongoDB ObjectId's and remaps foreign keys.
- Automatically copies across types correctly (eg numbers and dates).## Usage
### Install
First install dependencies:
npm install
### Setup
Edit config.js. Add the connection string for your SQL database. Modify the MongoDB connection string if necessary. Set the name of your target database in MongoDB.
### Run
node index.js
### Wait
It might take some time to replicate!
## More!
Find more like this in my new book [Data Wrangling with JavaScript](http://bit.ly/2t2cJu2)