Skip to content
Redis script for mapping external ID's to sequential ones.
JavaScript
Latest commit 275dbcc Feb 27, 2013 @gjohnson release 0.0.3
Failed to load latest commit information.
test script caching via SCRIPT LOAD Feb 27, 2013
.gitignore initial commit Dec 16, 2012
.travis.yml initial commit Dec 16, 2012
Makefile initial commit Dec 16, 2012
README.md release 0.0.3 Feb 27, 2013
index.js script caching via SCRIPT LOAD Feb 27, 2013
package.json release 0.0.3 Feb 27, 2013

README.md

redis-identity

Redis script for mapping external ID's to sequential ones. Adapted from crashlytics.

install

$ npm install redis-identity

usage

Pass in a node-redis client, and an optional key to use for the id mappings.

var redis = require('redis')
  , client = redis.createClient()
  , identity = require('redis-identity')(client);

identity('xxx-123-456', function(err, id){
  // ...
});

The second argument is the optional for the mapping, it defaults to identity-map.

var redis = require('redis')
  , client = redis.createClient()
  , identity = require('redis-identity')(client, 'my-id-map');

identity('xxx-123-456', function(err, id){
  // ...
});

notes

  • this will only work with node_redis >= 0.8.2.

license

MIT

Something went wrong with that request. Please try again.