Versions in this module Expand all Collapse all v1 v1.0.5 Apr 8, 2024 v1.0.3 Apr 8, 2024 Changes in this version + const CSV + const JSON + var Usage = ... + type CSVExportOutput struct + Fields []string + NoHeaderLine bool + NumExported int64 + func NewCSVExportOutput(fields []string, noHeaderLine bool, out io.Writer) *CSVExportOutput + func (csvExporter *CSVExportOutput) ExportDocument(document bson.D) error + func (csvExporter *CSVExportOutput) ExportDocumentCustom(document bson.D) error + func (csvExporter *CSVExportOutput) Flush() error + func (csvExporter *CSVExportOutput) WriteFooter() error + func (csvExporter *CSVExportOutput) WriteHeader() error + type ExportOutput interface + ExportDocument func(bson.D) error + Flush func() error + WriteFooter func() error + WriteHeader func() error + type InputOptions struct + AssertExists bool + ForceTableScan bool + Limit int64 + Query string + QueryFile string + ReadPreference string + Skip int64 + SlaveOk bool + Sort string + func (*InputOptions) Name() string + func (inputOptions *InputOptions) GetQuery() ([]byte, error) + func (inputOptions *InputOptions) HasQuery() bool + type JSONExportOutput struct + ArrayOutput bool + JSONFormat JSONFormat + NumExported int64 + Out io.Writer + PrettyOutput bool + func NewJSONExportOutput(arrayOutput bool, prettyOutput bool, out io.Writer, jsonFormat JSONFormat) *JSONExportOutput + func (jsonExporter *JSONExportOutput) ExportDocument(document bson.D) error + func (jsonExporter *JSONExportOutput) Flush() error + func (jsonExporter *JSONExportOutput) WriteFooter() error + func (jsonExporter *JSONExportOutput) WriteHeader() error + type JSONFormat string + const Canonical + const Relaxed + type MongoExport struct + ExportOutput ExportOutput + InputOpts *InputOptions + OutputOpts *OutputFormatOptions + ProgressManager progress.Manager + SessionProvider *db.SessionProvider + ToolOptions *options.ToolOptions + func New(opts Options) (*MongoExport, error) + func (exp *MongoExport) Close() + func (exp *MongoExport) Export(out io.Writer) (int64, error) + func (exp *MongoExport) GetOutputWriter() (io.WriteCloser, error) + type Options struct + ParsedArgs []string + func ParseOptions(rawArgs []string, versionStr, gitCommit string) (Options, error) + type OutputFormatOptions struct + CSVOutputType bool + FieldFile string + Fields string + JSONArray bool + JSONFormat JSONFormat + NoHeaderLine bool + OutputFile string + Pretty bool + Type string + func (*OutputFormatOptions) Name() string