@jsfriends/mongodb-utils
Dumps and restores MongoDB collections in JSON format. Can upload dump to AWS S3.
Last updated 9 months ago by ndreipoppa .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @jsfriends/mongodb-utils 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.3                                ...           latest (9 months ago)

3 Versions

  • 0.1.3                                ...           9 months ago
  • 0.1.2                                ...           9 months ago
  • 0.1.1                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 3
Last Month 6
Dependencies (5)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |