This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Heroku Pull Request | |
| on: pull_request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # shut down redis-server (if applicable) | |
| REDIS_SERVER_PID_FILE=/tmp/redis-server.pid | |
| (kill $(cat $REDIS_SERVER_PID_FILE) 2>&1) >/dev/null | |
| sleep 0.1 | |
| # start redis-server | |
| nohup redis-server redis.conf >/dev/null 2>&1 & | |
| sleep 0.1 | |
| echo $! > $REDIS_SERVER_PID_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stream = redis.scanStream({ match: '*' }); | |
| let keys = []; | |
| stream.on('data', (resultKeys) => { | |
| keys = keys.concat(resultKeys); | |
| }); | |
| stream.on('end', () => { | |
| console.log(keys); // returns ['key'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await redis.scan(0, 'MATCH', '*'); // returns ['0', ['key']] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await redis.keys('*'); // returns ['key'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await redis.keys('k*'); // returns ['key'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await redis.keys('key1', 'key2'); | |
| await redis.keys(['key1', 'key2']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await redis.keys('key'); // returns ['key'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await redis.del(['key1', 'key2']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await redis.del('key'); // returns 1 |