Redis script for mapping external ID's to sequential ones. Adapted from crashlytics.
$ npm install redis-identity
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){
// ...
});
- this will only work with node_redis >= 0.8.2.
MIT