0
0
Redisquery~10 mins

Sending multiple commands in pipeline 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 pipeline.

Redis
pipe = client.[1]()
Drag options to blanks, or click blank then click option'
Amulti
Bexecute
Ctransaction
Dpipeline
Attempts:
3 left
💡 Hint
Common Mistakes
Using execute() instead of pipeline() to start the pipeline.
Confusing multi() with pipeline().
2fill in blank
medium

Complete the code to add a SET command to the pipeline.

Redis
pipe.[1]('key1', 'value1')
Drag options to blanks, or click blank then click option'
Aget
Bset
Cdelete
Dappend
Attempts:
3 left
💡 Hint
Common Mistakes
Using get() instead of set() to add a SET command.
Using delete() which removes keys instead of storing a value.
3fill in blank
hard

Fix the error in the code to execute the pipeline.

Redis
results = pipe.[1]()
Drag options to blanks, or click blank then click option'
Aexecute
Bstart
Crun
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using start() or commit() which do not exist in Redis pipeline.
Using run() which is not a Redis pipeline method.
4fill in blank
hard

Fill both blanks to add two commands and execute the pipeline.

Redis
pipe.[1]('key2', 'value2')
pipe.[2]('key2')
results = pipe.execute()
Drag options to blanks, or click blank then click option'
Aset
Bget
Cdelete
Dappend
Attempts:
3 left
💡 Hint
Common Mistakes
Using get() before set() which may return None.
Using delete() which removes keys instead of retrieving.
5fill in blank
hard

Fill all three blanks to add SET, INCR, and GET commands in the pipeline.

Redis
pipe.[1]('counter', 1)
pipe.[2]('counter')
pipe.[3]('counter')
results = pipe.execute()
Drag options to blanks, or click blank then click option'
Aset
Bincr
Cget
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using delete() which removes the key instead of incrementing.
Mixing order of commands causing unexpected results.