{
    "id": "couchdb_cheat_sheet",
    "name": "CouchDB",
    "description": "CouchDB HTTP API Overview",

    "metadata": {
        "sourceName": "CouchDB",
        "sourceUrl" : "http://docs.couchdb.org/"
    },

    "template_type": "terminal",
    
    "aliases": [
        "couch", "couch api", "couchdb api"
    ],

    "section_order": [
        "General",
        "HTTP API",
        "Document API"
    ],

    "sections": {

        "General": [
            {
                "key": "couchdb start",
                "val": "Starts a CouchDB instance"
            },
            {
                "key": "http://localhost:5984/_utils",
                "val": "Starts a CouchDB instance"
            },
            {
                "key": "brew install couchdb",
                "val": "Installs CouchDB on Mac OSx"
            },
            {
                "key": "apt-get install couchdb -y",
                "val": "Installs CouchDB on Ubuntu"
            }
        ],

        "HTTP API": [
            {
                "key": "curl -XGET localhost:5984",
                "val": "Retrieves information about this node (GET)"
            },
            {
                "key": "curl -XGET localhost:5984/_active_tasks",
                "val": "Retrieves the list of active tasks (GET)"
            },
            {
                "key": "curl -XGET localhost:5984/_all_dbs",
                "val": "Retrieves the list of database names (GET)"
            },
            {
                "key": "curl -XGET localhost:5984/_config",
                "val": "Retrieves the instance configuration (GET)"
            },
            {
                "key": "curl -XGET localhost:5984/_db_updates",
                "val": "Retrieves the latest database change (GET)"
            },
            {
                "key": "curl -XGET localhost:5984/_log",
                "val": "Tails the main log file (GET)"
            },
            {
                "key": "curl -XGET localhost:5984/_stats",
                "val": "Statistics about the current node (GET)"
            },            
            {
                "key": "curl -XGET localhost:5984/_uuids",
                "val": "UUIDs generated by CouchDB (GET)"
            }
        ],

        "Document API": [
            {
                "key": "curl -XPUT localhost:5984/\\{db_name\\}",
                "val": "Creates a new database (POST)"
            },
            {
                "key": "curl -XGET localhost:5984/\\{db_name\\}",
                "val": "Returns database information (GET)"
            },
            {
                "key": "curl -XGET localhost:5984/\\{db_name\\}/_all_docs",
                "val": "Returns all the documents in the database (GET)"
            },
            {
                "key": "curl -XGET localhost:5984/\\{db_name\\}/\\{doc_id\\}",
                "val": "Returns the document (GET)"
            }
        ]

    }
}
