Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Latest commit

 

History

History
70 lines (53 loc) · 2.11 KB

README.md

File metadata and controls

70 lines (53 loc) · 2.11 KB

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.