Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kinolag/mongo_import
A node app to import data from an xlsx file into MongoDB using mongoose
https://github.com/kinolag/mongo_import
data-import-handler mocha mongodb mongoose nodejs
Last synced: 28 days ago
JSON representation
A node app to import data from an xlsx file into MongoDB using mongoose
- Host: GitHub
- URL: https://github.com/kinolag/mongo_import
- Owner: kinolag
- Created: 2024-03-27T19:01:16.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T12:11:19.000Z (5 months ago)
- Last Synced: 2024-10-01T05:16:44.326Z (about 1 month ago)
- Topics: data-import-handler, mocha, mongodb, mongoose, nodejs
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mongo_import: a node app to import data from an xlsx file into MongoDB using mongoose
## How to use the app:
• make sure you have MongoDB, Node and npm installed on your system
• clone this repo to your system
• create a local Mongo database, or identify an existing one to import the data into
• add a `.env` file to the repo on your system and set your MongoDB connection string as env variables, named: `DB_URL_DEV` and `DB_URL_PRD`
_A DEV db is enough to use the app in the development environment._
• in the terminal, `cd` to the project folder, then run:
`npm install` to install the node packages• run `npm run start-db` (this will run `mongod`, and only needs to be run once, not at every import attempt)
• to start a data import, run:
`npm start ""`e.g. `npm start "./data/Test_Import.xlsx"`
• two xlsx files are included in the /data folder:
`Test_Import.xlsx` and `Tracks_Import_8.xlsx`you can use these or you can import a different file on your system (by passing its path when calling the process).
• check the log for info and errors
• some tests are included and can be run via: `npm test`
• you can optionally delete all imported tracks running:
`npm run delete`