mongo

package
v0.0.0-...-d4285bb Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2014 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package mongo is used to export/import collections from/to a mongo database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportData

func ExportData(db string, cols []string) (string, error)

ExportData exports data from collections in the specified database to a specified location as a zip file. This makes use of the mongoexport utility.

func ImportData

func ImportData(db string, zip []byte) error

ImportData imports collections stored in a zip file to the specified database.

Types

type Importer

type Importer string

Importer is used to walk a directory containing mongodb collections stored in json files and then import these collections into the database specified by this Importer.

func (Importer) ImportFile

func (i Importer) ImportFile(path string, info os.FileInfo, inErr error) error

ImportFile imports a single collection found in the file specified by path to the database specified by this Importer. This makes use of the mongoimport utility.

Jump to

Keyboard shortcuts

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