Coder Social home page Coder Social logo

couch-shell's Introduction

couch-shell is a basic shell to interact with a CouchDB server.

Install with rubygems:

  $ sudo gem install couch-shell

Only tested with Ruby 1.9!

Example session:

  $ couch-shell 127.0.0.1:5984
  couch-shell 0.0.8
  Set server to http://127.0.0.1:5984
  GET / 200 OK   vars: r0, j0
  {
    "couchdb": "Welcome",
    "version": "1.0.1"
  }
  >> cput contacts
  PUT /contacts 201 Created   vars: r1, j1
  {
    "ok": true
  }
  GET /contacts 200 OK   vars: r2, j2
  body has 213 bytes
  contacts >> post {"name":"Jim", "email":"[email protected]"}
  POST /contacts 201 Created   vars: r3, j3
  {
    "ok": true,
    "id": "37425dfe6340ac376572f5042f000de1",
    "rev": "1-aefa5e0e3de5ac4fcc0e28b725f1d898"
  }
  contacts >> cd $(id)
  contacts/37425dfe6340ac376572f5042f000de1 >> get
  GET /contacts/37425dfe6340ac376572f5042f000de1 200 OK   vars: r4, j4
  {
    "_id": "37425dfe6340ac376572f5042f000de1",
    "_rev": "1-aefa5e0e3de5ac4fcc0e28b725f1d898",
    "name": "Jim",
    "email": "[email protected]"
  }
  contacts/37425dfe6340ac376572f5042f000de1 >> member name "Jim Thompson"
  PUT /contacts/37425dfe6340ac376572f5042f000de1/?rev=1-aefa5e0e3de5ac4fcc0e28b725f1d898 201 Created   vars: r5, j5
  {
    "ok": true,
    "id": "37425dfe6340ac376572f5042f000de1",
    "rev": "2-6640ecdc0102456c7b924768e5bbc4c1"
  }
  contacts/37425dfe6340ac376572f5042f000de1 >> get
  GET /contacts/37425dfe6340ac376572f5042f000de1 200 OK   vars: r6, j6
  {
    "_id": "37425dfe6340ac376572f5042f000de1",
    "_rev": "2-6640ecdc0102456c7b924768e5bbc4c1",
    "name": "Jim Thompson",
    "email": "[email protected]"
  }
  contacts/37425dfe6340ac376572f5042f000de1 >> exit
  bye

couch-shell's People

Stargazers

 avatar  avatar

Watchers

 avatar

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.