You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
1.1 KiB
1.1 KiB
v3 to v4 Migration Guide
Version 4 of Node Redis is a major refactor. While we have tried to maintain backwards compatibility where possible, several interfaces have changed. Read this guide to understand the differences and how to implement version 4 in your application.
Breaking Changes
See the Change Log.
Promises
Node Redis now uses native Promises by default for all functions.
Legacy Mode
Use legacy mode to preserve the backwards compatibility of commands while still getting access to the updated experience:
const client = createClient({
legacyMode: true
});
// legacy mode
client.set('key', 'value', 'NX', (err, reply) => {
// ...
});
// version 4 interface is still accessible
await client.v4.set('key', 'value', {
NX: true
});
createClient
The configuration object passed to createClient
has changed significantly with this release. See the client configuration guide for details.