Skip to content

Commit 10fa321

Browse files
committed
docs: update docs for scan function
1 parent b65e7ce commit 10fa321

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Diff for: README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cache.set('my key', { foo: 'bar' }, function (error) {
3131

3232
// delete entry
3333
cache.del('my key', function (error){
34-
34+
3535
if (error) throw error;
3636

3737
console.log('value deleted');
@@ -48,7 +48,7 @@ cache.set('my key', { foo: 'bar' }, function (error) {
4848
Create `cacheman-redis` instance. `options` are redis valid options including `port` and `host`.
4949

5050
```javascript
51-
var options = {
51+
var options = {
5252
port: 9999,
5353
host: '127.0.0.1',
5454
password: 'my-p@ssw0rd'
@@ -129,6 +129,18 @@ cache.clear(function (err) {
129129
});
130130
```
131131

132+
### cache.scan(cursor, count, [fn])
133+
134+
[Scan](https://redis.io/commands/scan) cache from a cursor point and return a count of values
135+
136+
```javascript
137+
cache.set('foo', { a: 'bar' }, 10, function (err) {
138+
cache.scan(0, 10, function (err, result) {
139+
console.log(result) // { cursor: 0, entries: [{ key: 'foo', data: { a: 'bar' } }] }
140+
});
141+
});
142+
````
143+
132144
## Run tests
133145

134146
``` bash

0 commit comments

Comments
 (0)