This repo just open to ideas, it's created for anyone who needs a mongoDB collection cloner.
A simple utility to clone MongoDB collections from a local database to a remote production database.
- Copies collections from one MongoDB instance to another.
- Uses environment variables for configuration.
-
Clone the repository:
git clone https://github.com/samueltesfayegari/MongoDB-cloner-TS.git
-
Install dependencies:
cd MongoDB-cloner-TS
npm install
-
Create a
.env
file in the root directory with the following: LOCAL_DB_URL=mongodb://localhost:27017/yourLocalDb DATABASE_URL=mongodb+srv://yourProductionDbUri
Run the script:
node copy-collection.ts