Giter Site home page Giter Site logo

mongo_scripts's Introduction

MongoDB Node Script Runner

Write and run custom scripts for your mongoDB using nodeJS.


Install

$ git clone https://github.com/ifatoki/mongo_scripts
$ cd mongo_scripts
$ npm install

Configuration

  1. Create a copy of the .env.sample file in the project and name it .env.

  2. Replace the default MONGO_URI with the mongo server you want to connect to.

  3. Replace the default DB_NAME with the name of the DB you would like to run the script on.

Running a script

  1. Replace the value in the SCRIPT_NAME field in the .env file with the filename of the script (already existing in the custom_scripts folder).

  2. Run npm run start

Setting up a new script

  1. In the custom_scripts dir, copy the file script_template.js and create a copy of it, naming it as you wish (note, this name is what you'd use to reference it in the .env file).

  2. Write your script logic below the line // Write your script here

  3. When done, run it as directed above in the Running a script section

mongo_scripts's People

Contributors

ifatoki avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.