Giter Club home page Giter Club logo

mcouch's Introduction

manta-couch

Put your CouchDB in Manta, attachments and docs and all

Usage

In JavaScript

var mantaCouch = require('manta-couch')

var mc = mantaCouch({
  client: myMantaClient,
  path: '~~/stor/my-couchdb',
  db: 'http://localhost:5984/my-couchdb',

  // If specified, will save sequence in this file, and read from it
  // on startup.  Highly recommended to avoid extra PUTs!
  seqFile: '.sequence',

  // you can also optionally specify a numeric sequence here:
  seq: 1234
})

In the command line:

mcouch http://localhost:5984/my-couch ~~/stor/my-couchdb

Full options:

mcouch - Relax with the Fishes
Usage: mcouch [args] COUCHDB MANTAPATH

    COUCHDB                             Full url to your couch, like
                                        http://localhost:5984/database
    MANTAPATH                           Remote path in Manta, like
                                        ~~/stor/database
    -Q FILE, --seq-file=FILE            File to store the sequence in
    -q NUMBER, --seq=NUMBER             Sequence ID to start at
    --inactivity-ms=MS                  Max ms to wait before assuming
                                        disconnection.
    -d, --delete                        Delete removed attachments and docs from
                                        manta
    -f, --forensic                      Track changes in a non-destructive way
    -a ACCOUNT, --account=ACCOUNT       Manta Account (login name)
    -h, --help                          Print this help and exit
    -i, --insecure                      Do not validate SSL certificate
    -k FINGERPRINT, --keyId=FINGERPRINT SSH key fingerprint
    -u URL, --url=URL                   Manta URL
    -v, --verbose                       verbose mode

When using the command line, you can also specify all the typical MANTA environment variables, or you can pass the typical Manta command-line arguments.

Manta Folder Structure

In non-forensic mode, mcouch will put the doc contents at {path}/{id}/doc.json, and store attachments at {path}/{id}/_attachments/{filename}.

If you enable deletes, then it will also permanently delete documents and attachments when they are removed. If delete is not enabled, then removed attachments will remain in the _attachments folder, and removed docs will not be removed.

In forensic mode, in addition to storing a doc.json, this is linked to {path}/{id}/{rev}.json where {rev} is the document revision id. Attachments are linked to {path}/{id}/_attachments/{filename}-{digest}. This is so that, even as the documents or attachments are modified, past versions can still be reconstructed. Deleting an attachment will remove its main file, but the link to the digest-tagged version will remain.

In forensic mode, deletes do not remove data permanently from Manta. Instead, deleting a document will cause the doc and all its attachments to be moved to a _deleted-{index} folder, and a _deleted:true record will be written to doc.json. The {index} value on the trash folder is incremented with each subsequent delete.

mcouch's People

Contributors

isaacs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

willcode2surf

mcouch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.