this file contains a simple script for connecting to mongodb
database for deleting all the data from a collection and importing data to a collection:
- you can delete all the data in your collection:
bun importDevData.ts --delete
- you can import your json data in your collection:
bun importDevData.ts --import
import dotenv from "dotenv";
import mongoose from "mongoose";
import fs from "fs";
/**