Permanently select database?
Can I permanently select a database for development usage, so that all following queries are run against that database - without having to be wrapped inside a select call like below?
client.select(3, function() {
client.stuff...
});
I had a look at the docs, but maybe I have just missed it.
I think, only one "select" required, when you initialize the connection, for example client.on('ready',
@jockster The usage of multiple databases in redis is discouraged by the devs, see https://groups.google.com/forum/#!topic/redis-db/u1IgtiWN0Ww
@skenqbx Thank you for letting me know.
Is there any good other option to be able to keep multiple environments going on the same server when developing/testing? Can we prefix all keys used by node-redis?
Hi @jockster generally running multiple Redis instances is considered best practice instead of using dbs. This gives effectively the same functionality while allowing you more flexibility. (e.g. moving one of the instances to a separate server)
There isn't currently a wrapper to auto-prefix keys in node_redis.
Well, for a team of developers - that means a lot of instances. Isn't there an simpler solution?
@jockster Prefixing made easy with https://github.com/linus/refix
Prefixing is on the ToDo-List and will be in one of the upcoming versions.