mongo-tools

module
v0.0.0-...-d67406e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2019 License: Apache-2.0

README

MongoDB Tools

  • bsondump - display BSON files in a human-readable format
  • mongoimport - Convert data from JSON, TSV or CSV and insert them into a collection
  • mongoexport - Write an existing collection to CSV or JSON format
  • mongodump/mongorestore - Dump MongoDB backups to disk in .BSON format, or restore them to a live database
  • mongostat - Monitor live MongoDB servers, replica sets, or sharded clusters
  • mongofiles - Read, write, delete, or update files in GridFS
  • mongotop - Monitor read/write activity on a mongo server
  • mongoreplay - Capture, observe, and replay traffic for MongoDB

Report any bugs, improvements, or new feature requests at https://jira.mongodb.org/browse/TOOLS

Building Tools

To build the tools, you need to have Go version 1.9 and up. go get will not work; you need to clone the repository to build it.

git clone https://github.com/mongodb/mongo-tools
cd mongo-tools

To use build/test scripts in the repo, you MUST set GOROOT to your Go root directory.

export GOROOT=/usr/local/go
Quick build

The build.sh script builds all the tools, placing them in the bin directory. Pass any build tags (like ssl or sasl) as additional command line arguments.

./build.sh
./build.sh ssl
./build.sh ssl sasl
Manual build

Source set_goenv.sh and run the set_goenv function to setup your GOPATH and architecture-specific configuration flags:

. ./set_goenv.sh
set_goenv

Pass tags to the go build command as needed in order to build the tools with support for SSL and/or SASL. For example:

mkdir bin
go build -o bin/mongoimport mongoimport/main/mongoimport.go
go build -o bin/mongoimport -tags ssl mongoimport/main/mongoimport.go
go build -o bin/mongoimport -tags "ssl sasl" mongoimport/main/mongoimport.go

Contributing

See our Contributor's Guide.

Documentation

See the MongoDB packages documentation.

Directories

Path Synopsis
Package bsondump converts BSON files into human-readable formats such as JSON.
Package bsondump converts BSON files into human-readable formats such as JSON.
main
Main package for the bsondump tool.
Main package for the bsondump tool.
legacy
json
Package json implements encoding and decoding of JSON objects as defined in RFC 4627.
Package json implements encoding and decoding of JSON objects as defined in RFC 4627.
lldb
Package lldb implements generic connection to MongoDB, and contains subpackages for specific methods of connection.
Package lldb implements generic connection to MongoDB, and contains subpackages for specific methods of connection.
lldb/kerberos
Package kerberos implements authentication to MongoDB using kerberos
Package kerberos implements authentication to MongoDB using kerberos
lldb/tlsgo
Package tlsgo provides a mgo connection using Go's native TLS library.
Package tlsgo provides a mgo connection using Go's native TLS library.
log
Package log provides a utility to log timestamped messages to an io.Writer.
Package log provides a utility to log timestamped messages to an io.Writer.
options
Package options implements command-line options that are used by all of the mongo tools.
Package options implements command-line options that are used by all of the mongo tools.
password
Package password handles cleanly reading in a user's password from the command line.
Package password handles cleanly reading in a user's password from the command line.
util
Package util provides commonly used utility functions.
Package util provides commonly used utility functions.
Package mongodump creates BSON data from the contents of a MongoDB instance.
Package mongodump creates BSON data from the contents of a MongoDB instance.
main
Main package for the mongodump tool.
Main package for the mongodump tool.
Package mongoexport produces a JSON or CSV export of data stored in a MongoDB instance.
Package mongoexport produces a JSON or CSV export of data stored in a MongoDB instance.
main
Main package for the mongoexport tool.
Main package for the mongoexport tool.
Package mongofiles provides an interface to GridFS collections in a MongoDB instance.
Package mongofiles provides an interface to GridFS collections in a MongoDB instance.
main
Main package for the mongofiles tool.
Main package for the mongofiles tool.
Package mongoimport allows importing content from a JSON, CSV, or TSV into a MongoDB instance.
Package mongoimport allows importing content from a JSON, CSV, or TSV into a MongoDB instance.
csv
Package csv reads and writes comma-separated values (CSV) files.
Package csv reads and writes comma-separated values (CSV) files.
main
Main package for the mongoimport tool.
Main package for the mongoimport tool.
Package mongorestore writes BSON data to a MongoDB instance.
Package mongorestore writes BSON data to a MongoDB instance.
main
Main package for the mongorestore tool.
Main package for the mongorestore tool.
ns
Package mongostat provides an overview of the status of a currently running mongod or mongos instance.
Package mongostat provides an overview of the status of a currently running mongod or mongos instance.
main
Main package for the mongostat tool.
Main package for the mongostat tool.
Package mongotop provides a method to track the amount of time a MongoDB instance spends reading and writing data.
Package mongotop provides a method to track the amount of time a MongoDB instance spends reading and writing data.
main
Main package for the mongotop tool.
Main package for the mongotop tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL