1.1.0 • Published 9 years ago

uber-cache-mongodb v1.1.0

Weekly downloads
10
License
-
Repository
github
Last release
9 years ago

mongodb backed implementation of uber-cache

See http://github.com/serby/uber-cache for more details

build status

Installation

  npm install uber-cache-mongodb

Usage

var Db = require('mongodb').Db
  , Server = require('mongodb').Server
  , server = new Server('localhost', 27017, { 'auto_reconnect': true })
  , db = new Db('uber-cache-db', server, { fsync: true, w: 1 })
  , UberCache = require('uber-cache-mongodb')

db.open(function(error, connection) {
  var cache = new UberCache(connection)
  cache.set('the key', 'the value', function() {
    cache.get('the key', function(error, value) {
      console.log(value)
      db.close()
    })
  })
})

Credits

Paul Serby follow me on twitter

Licence

Licenced under the New BSD License

1.1.0

9 years ago

0.0.1

10 years ago