0.0.5 • Published 11 months ago
mongokit v0.0.5
mongokit
A command line toolkit for interacting with MongoDB.
Install
npm install -g mongokitConnect your database
There are two options for connecting the mongokit commands to your own database.
CLI option
Use the option --uri and set it to the connection string for your database when running a command.
Example:
--uri mongodb://localhost:27017Environment variable
Set the environment variable MONGO_URI to the connection string for your database before running commands.
Example:
export MONGO_URI=mongodb://localhost:27017Or on Windows:
set MONGO_URI=mongodb://localhost:27017Run commands
There is a full suite of commands you can run. Here's an example to get a whole collection as JSON data:
mongokit get collection <collection-name>To see the full list of commands to get and set data:
mongokit --helpRun commands in development
Clone the repo and then install dependencies:
cd mongokit
npm installRun commands:
npx ts-node src/cli.ts get dbs