Git Product home page Git Product logo

couchdb's Introduction

CouchDb - a library for accessing couchDB easily

Description

a little wrapper for curl calls to manage data by NoSql CouchDb.

Test Coverage

test-coverage

Requirements for PHPUnit testing

  • curl installed for php
  • CouchDb installed locally
  • port: 5984
  • user: phpunit
  • pass: unittests
  • db: unittests

Usage

$cdb = new CouchDb();

// set server and port
$cdb->setServer($server = 'http://127.0.0.1', $port = 5984)

// set db
$cdb->setDb($db)

// set user and pass (optional)
$cdb->setUser($user, $pass)

// set response as object or json string (optional)
$cdb->setResponseAsObject($option = false)

// send data
// method = PUT|GET|DELETE
// id = document id
// data = string containing data (optional)
$cdb->send($method, $id, $data = null)

// add attachment to existing document
$cdb->addAttachment($id, $filename)

// creates view
// designName = string containing name
// viewName = string containing name of View
// script = string containting the javascript 
$cdb->createView($designName, $viewName, $script)

// deletes the view Part document
// for deleting design document use send() with delete option
$cdb->deleteView($designName, $viewName = null)

// gets data from a view
// filtering by Keyvalue at the url (?key=bla)
$cdb->getView($design, $view, $keyValue = null)

couchdb's People

Contributors

cybeaer avatar

Watchers

James Cloos avatar  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.