Documentation
¶
Overview ¶
Package bsondump converts BSON files into human-readable formats such as JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Usage = `` /* 131-byte string literal not displayed */
Functions ¶
This section is empty.
Types ¶
type BSONDump ¶
type BSONDump struct {
// generic mongo tool options
ToolOptions *options.ToolOptions
// BSONDumpOptions defines options used to control how BSON data is displayed
BSONDumpOptions *BSONDumpOptions
// Path to the BSON file
FileName string
// Handle to where the BSON data should be displayed
Out io.Writer
// contains filtered or unexported fields
}
BSONDump is a container for the user-specified options and internal state used for running bsondump.
func (*BSONDump) Debug ¶
Debug iterates through the BSON file and for each document it finds, recursively descends into objects and arrays and prints a human readable BSON representation containing the type and size of each field. It returns the number of documents processed and a non-nil error if one is encountered before the end of the file is reached.
func (*BSONDump) JSON ¶
JSON iterates through the BSON file and for each document it finds, recursively descends into objects and arrays and prints the human readable JSON representation. It returns the number of documents processed and a non-nil error if one is encountered before the end of the file is reached.
type BSONDumpOptions ¶
type BSONDumpOptions struct {
// Format to display the BSON data file
Type string `long:"type" default:"json" default-mask:"-" description:"type of output: debug, json (default 'json')"`
// Validate each BSON document before displaying
ObjCheck bool `long:"objcheck" description:"validate BSON during processing"`
// Display JSON data with indents
Pretty bool `long:"pretty" description:"output JSON formatted to be human-readable"`
}
func (*BSONDumpOptions) Name ¶
func (_ *BSONDumpOptions) Name() string
func (*BSONDumpOptions) PostParse ¶
func (_ *BSONDumpOptions) PostParse() error
func (*BSONDumpOptions) Validate ¶
func (_ *BSONDumpOptions) Validate() error