Skip to content

A Node.js script for importing track data from Excel files into MongoDB using Mongoose. Written in **TypeScript** and fully tested with **Mocha**, **Chai**, and **MongoMemoryServer**.

Notifications You must be signed in to change notification settings

KongLamDev/curve-track-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Curve Track Import Script

A Node.js script for importing track data from Excel files into MongoDB using Mongoose. Written in TypeScript and fully tested with Mocha, Chai, and MongoMemoryServer.


Features

  • Parse Excel .xlsx files using ExcelJS
  • Map spreadsheet columns to MongoDB document fields
  • Validate rows and report errors without stopping the import
  • Automatically create a default contract (Contract 1)
  • Supports aliases as semi-colon separated values
  • Fully tested with in-memory MongoDB

Requirements

  • Node.js >= 20
  • MongoDB (for running against a real database)
  • Npm for dependency management

Installation

  1. Clone the repository:
git clone <repository-url>
cd curve-track-script
  1. Install dependencies
npm install
  1. Create a .env file in the root folder:
MONGO_URI=mongodb://127.0.0.1:27017/curve-track-db

Replace the URI with your MongoDB connection string.

  1. Run the script
npm run importTracks

Testing

npm test

About

A Node.js script for importing track data from Excel files into MongoDB using Mongoose. Written in **TypeScript** and fully tested with **Mocha**, **Chai**, and **MongoMemoryServer**.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published