-
-
Save danstreeter/afc1faf45fcb6dd284265d941916eb0c to your computer and use it in GitHub Desktop.
Scan all keys in redis insight
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
/* | |
* Run the following script in browser dev tools when having redis insight open | |
* to continue searching for the keypattern until the scan is completed | |
* | |
* Changelog | |
* 2022-08-23 - danstreeter - Update to make work in RedisInsightv2 `2.6.0` (Note TODO) | |
*/ | |
var clickIntervalId = setInterval( | |
() => { | |
var button = document.querySelector('[data-testid=scan-more'); | |
if (button == null) { | |
console.log("Clearing Interval as button does not exist") | |
clearInterval(clickIntervalId); | |
} | |
// TODO - Determine what to do when the entire dataset is scanned | |
// if (button.disabled) { | |
// console.log("Clearing Interval as button is disabled") | |
// clearInterval(intervalId); | |
// } | |
var loading_bar = document.querySelector('[data-testid=progress-key-list'); | |
if (loading_bar == null) { | |
console.log("Loading next keys") | |
button.click(); | |
} | |
else { | |
console.log("... waiting for last results to be loaded.\nRun 'clearInterval(clickIntervalId)' to stop this process") | |
} | |
}, | |
200 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment