0
0
Redisquery~10 mins

EXEC to execute in Redis - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a Redis transaction.

Redis
redis.call('[1]')
Drag options to blanks, or click blank then click option'
AEXEC
BMULTI
CWATCH
DDISCARD
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC to start the transaction instead of MULTI.
Using WATCH which is for monitoring keys, not starting transactions.
2fill in blank
medium

Complete the code to execute all commands in the current Redis transaction.

Redis
redis.call('[1]')
Drag options to blanks, or click blank then click option'
AMULTI
BDISCARD
CEXEC
DWATCH
Attempts:
3 left
💡 Hint
Common Mistakes
Using MULTI instead of EXEC to execute commands.
Using DISCARD which cancels the transaction.
3fill in blank
hard

Fix the error in the code to properly execute a Redis transaction.

Redis
redis.call('MULTI')
redis.call('SET', 'key', 'value')
redis.call('[1]')
Drag options to blanks, or click blank then click option'
AEXEC
BDISCARD
CWATCH
DMULTI
Attempts:
3 left
💡 Hint
Common Mistakes
Calling MULTI again instead of EXEC.
Using DISCARD which cancels the transaction.
4fill in blank
hard

Fill both blanks to start a transaction and then cancel it.

Redis
redis.call('[1]')
redis.call('[2]')
Drag options to blanks, or click blank then click option'
AMULTI
BEXEC
CDISCARD
DWATCH
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC instead of DISCARD to cancel.
Using WATCH which does not cancel transactions.
5fill in blank
hard

Fill all three blanks to watch a key, start a transaction, and execute it.

Redis
redis.call('[1]', 'mykey')
redis.call('[2]')
redis.call('[3]')
Drag options to blanks, or click blank then click option'
AMULTI
BEXEC
CWATCH
DDISCARD
Attempts:
3 left
💡 Hint
Common Mistakes
Using DISCARD instead of EXEC to run the transaction.
Starting transaction before watching keys.