Scripts for Redis Database
Make sure you have installed following packages:
$ npm install
Each script has its own config object inside the config.js file
const DB_CONFIG = {
host: 'localhost',
port: 7001,
password: '',
}
const POPULATE_DB_WITH_ZSETS_СONFIG = {
keyNameStartWith: 'key',
count: 10,
}
...
# Add strings to the database
$ node populate-db-with-strings.js
# Add zsets to the database
$ node populate-db-with-zsets.js
# Add sets to the database
$ node populate-db-with-sets.js
# Populate set with members
$ node populate-set-with-members.js
# Add hashes to the database
$ node populate-db-with-hashes.js
# Populate hash with fields
$ node populate-hash-with-fields.js
# Add lists to the database
$ node populate-db-with-lists.js
# Add jsons to the database
$ node populate-db-with-jsons.js
# Populate zset with members
$ node populate-zset-with-members.js
# Populate list with elements
$ node populate-list-with-elements.js
# Delete all the keys of all the existing databases
$ node flush-db.js
# Delete multiple keys from the selected database
$ delete-keys-from-db.js