https://github.com/emanuelefavero/mongo-connect-script
This Node.js script is used to establish a connection to a MongoDB database
https://github.com/emanuelefavero/mongo-connect-script
javascript mongodb mongoose nodejs script
Last synced: 3 months ago
JSON representation
This Node.js script is used to establish a connection to a MongoDB database
- Host: GitHub
- URL: https://github.com/emanuelefavero/mongo-connect-script
- Owner: emanuelefavero
- License: mit
- Created: 2024-08-06T02:54:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-07T04:07:20.000Z (about 1 year ago)
- Last Synced: 2025-03-29T16:12:46.340Z (6 months ago)
- Topics: javascript, mongodb, mongoose, nodejs, script
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MongoDB Connect Script
This Node.js script is used to establish a connection to a MongoDB database. It can be useful to prevent the database from pausing due to inactivity.
## Installation
1. Clone the repository
2. Run `npm install` to install the dependencies
3. Create a `.env` file in the root directory and add the following environment variables:
- `MONGO_URI`: The URI of the MongoDB database
4. Run `npm start` to start the script
5. The script will connect to the database thus preventing it from pausing due to inactivity> Tip: You could add this script to a cron job or a scheduled task to run it at regular intervals
## License
- [MIT](LICENSE.md)