Skip to content

PaulCapestany/sgdocloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

sgdocloader

sgdocloader is a command line tool that makes it easy to add JSON documents to a Sync Gateway node.

Installation

You can download pre-built binaries for Mac OS X, Linux, and Windows and place them anywhere in your $PATH and you should be set.

If you prefer to build from source (and already have Go installed):

go get github.com/paulcapestany/sgdocloader

Usage

You're required to specify the Sync Gateway URL (including port) and bucket name, as well as the file(s) and/or directories that contain the JSON documents that you'd like to load.

Load JSON files located at some directory:

sgdocloader -n http://127.0.0.1:4984 -b mybucket /path/to/some/data/directory

Load individual JSON files:

sgdocloader -n http://127.0.0.1:4984 -b mybucket somedata.json moredata.json

Load multiple documents from files via _bulk_docs by using the -k flag:

sgdocloader -n http://127.0.0.1:4984 -b mybucket -k manydocs.json

The names of the files/directories don't matter. The _id field for each doc will be auto-generated if not already included within the document(s). The heavy lifting is all done by the excellent go-couch package.

This is a work in progress, but comments/suggestions/pull requests are definitely welcomed!

About

sgdocloader is a CLI tool that makes it easy to add JSON documents to Sync Gateway

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages