Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Node package for easily transferring databases from different production environments as well as backing up databases. In the future, I will add suport for the AWS as well.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
Octocat-spinner-32 peon.js
README.md

Peon

Version

0.0.1

About

transfer(dbs, collections, options)

Options gets passed into the mongo find call, so options should be the valid query operators

drop(db, collection)

Drops the specific collection from the given database.

dropAll(db)

Drops all collections from the given database

Uses

Transferring Basic

var peon = require('./peon');

var dbs = ['prod', 'stage', 'dev'];
var collections = ['notifications'];
var options = {};

/**
 * Transfer the notifications collection
 * from production to stage and dev
 */
peon.transfer(dbs, collections, options);

Transferring Advanced

var peon = require('./peon');

var dbs = ['prod', 'stage'];
var collections = ['events'];
var options = {
    created: { $gte: '2013-07-31T18:25:17.336Z'
};
peon.transfer(dbs, collections, options);

Dropping collections

// Drops collection notifications in dev
peon.drop('dev', 'notifications');

// Drops all collections in the dev database
peon.dropAll('dev');

Execution

git clone [git-repo-url] ./bin/peon
var peon = require('../bin/peon);
Something went wrong with that request. Please try again.