Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/preetam/atto
A minimalist Couchbase driver
https://github.com/preetam/atto
Last synced: 4 days ago
JSON representation
A minimalist Couchbase driver
- Host: GitHub
- URL: https://github.com/preetam/atto
- Owner: Preetam
- Created: 2012-09-11T22:42:25.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-06T19:09:18.000Z (over 11 years ago)
- Last Synced: 2024-12-16T00:26:41.279Z (25 days ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Use the official Couchbase driver: https://github.com/couchbase/couchnode
----
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