npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jsfriends/mongodb-utils

v0.1.3

Published

Dumps and restores MongoDB collections in JSON format. Can upload dump to AWS S3.

Downloads

6

Readme

mongodb-utils

Dumps and restores MongoDB collections in JSON format. Can upload dump to AWS S3.

oclif Version Downloads/week License

Usage

$ npm install -g @jsfriends/mongodb-utils
$ mongodb-utils COMMAND
running command...
$ mongodb-utils (-v|--version|version)
@jsfriends/mongodb-utils/0.1.3 darwin-x64 node-v10.16.1
$ mongodb-utils --help [COMMAND]
USAGE
  $ mongodb-utils COMMAND
...

Commands

mongodb-utils archive [OPTIONS]

Dumps the specified MongoDB collection

USAGE
  $ mongodb-utils archive [OPTIONS]

OPTIONS
  --authenticationDatabase=authenticationDatabase  Authentication database where the specified username exists
  --awsCreds=awsCreds                              Path to AWS Credentials in JSON form
  --bucket=bucket                                  AWS S3 Bucket
  --collection=collection                          (required) Mongo collection name
  --db=db                                          (required) Mongo database name
  --dumpOutputDir=dumpOutputDir                    [default: backups/] Directory where to store the dump
  --host=host                                      (required) Mongo host
  --password=password                              Mongo user password
  --port=port                                      (required) Mongo port
  --query=query                                    Mongo query to filter what data to be dumped
  --s3DestDir=s3DestDir                            [default: /] Destination dir in S3 Bucket
  --sendToS3
  --ssl                                            Use SSL for Mongo connection
  --username=username                              Mongo user

EXAMPLES
  mongodb-utils archive --host 127.0.0.1 --port 27017 --db local --collection startup_log --query '{"boss": {"$eq": 
  true}}
  mongodb-utils archive --host 127.0.0.1 --port 27017 --db local --collection startup_log --query '{"boss": {"$eq": 
  true}}' --sendToS3 --awsCreds aws.json --bucket test-bukket-ro --s3DestDir backups

See code: src/commands/archive.js

mongodb-utils help [COMMAND]

display help for mongodb-utils

USAGE
  $ mongodb-utils help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

mongodb-utils restore [OPTIONS]

Restores the specified MongoDB archive

USAGE
  $ mongodb-utils restore [OPTIONS]

OPTIONS
  --archive=archive                                (required) Archive file to restore
  --authenticationDatabase=authenticationDatabase  Authentication database where the specified username exists
  --collection=collection                          (required) Mongo collection name
  --db=db                                          (required) Mongo database name
  --host=host                                      (required) Mongo host
  --password=password                              Mongo user password
  --port=port                                      (required) Mongo port
  --ssl                                            Use SSL for Mongo connection
  --username=username                              Mongo user

EXAMPLE
  mongodb-utils restore --host localhost --port 27017 --db local --collection employees --archive backups/archive.json

See code: src/commands/restore.js

mongodb-utils sendToS3 [OPTIONS]

Uploads the specified file to S3

USAGE
  $ mongodb-utils sendToS3 [OPTIONS]

OPTIONS
  --bucket=bucket            (required) AWS S3 Bucket
  --credentials=credentials  (required) Path to AWS Credentials in JSON form
  --destDir=destDir          [default: /] Destination dir in S3 Bucket
  --file=file                (required) File to upload in S3 Bucket

EXAMPLE
  mongodb-utils sendToS3 --bucket test-bukket-ro --credentials aws.json  --file backups/backmeup.json --destDir backups

See code: src/commands/sendToS3.js