Coder Social home page Coder Social logo

atto's Introduction

Atto

Atto is a minimalist Couchbase driver.

What does Atto do?

Atto lets you use Couchbase's memcached protocol to work with documents. Atto also supports HTTP views.

Atto automatically detects HTTP nodes. The implementation isn't very rich at this point, but it will get better in future releases.

What doesn't Atto do?

There is no way to create views from Atto.

Atto is not a "smart" memcached client. It won't automatically connect to multiple memcached servers. I suggest using Moxi, which ships with Couchbase.

API reference

Installation is simple.

$ npm install atto

Creating the object

var db = require('atto')(memcachedPort, memcachedHost, dbHost, bucketName, bucketUsername, bucketPassword)

Callbacks

Callbacks should be in the following format:

function(error, response) {}

Set

db.set(key, value, cb[, lifetime]);

Get

db.get(key, cb);

Response: An object if the value is valid JSON. Otherwise, the response is a string.

Increment

db.inc(key, value, cb);

Response: The incremented value.

Decrement

db.dec(key, value, cb);

Response: The decremented value.

View

db.view(designDoc, viewName, params, cb);

The first two parameters are strings. params should be an object (for querystring):

{
	key: 'documentKey',
	limit: 10
}

Response: Unmodified JSON from the HTTP request.

TODO

  • Optional bucket authentication (required right now)
  • More memcached functions

atto's People

Contributors

djrenren 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.