uber-cache-mongodb

1.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i uber-cache-mongodb

Weekly Downloads

1

Version

1.1.0

License

none

Last publish

Collaborators

  • serby