0
0
Redisquery~10 mins

SCARD for set size 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 get the number of elements in the set named 'myset'.

Redis
SCARD [1]
Drag options to blanks, or click blank then click option'
Acountset
Bsetcount
Celements
Dmyset
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong set name that does not exist.
Forgetting to provide the set name after SCARD.
2fill in blank
medium

Complete the code to find the size of the set stored in the variable 'setKey'.

Redis
SCARD [1]
Drag options to blanks, or click blank then click option'
AsetKey
Bsetkey
CSetKey
Dset_key
Attempts:
3 left
💡 Hint
Common Mistakes
Changing the case of the key name.
Using underscores or other characters not in the key.
3fill in blank
hard

Fix the error in the command to get the set size of 'users'.

Redis
SCARD [1]
Drag options to blanks, or click blank then click option'
Ausers
Buser
CuserSet
Duser_set
Attempts:
3 left
💡 Hint
Common Mistakes
Using a singular form instead of plural.
Adding extra characters or underscores.
4fill in blank
hard

Fill both blanks to get the size of the set named 'activeUsers' and store it in variable 'count'.

Redis
count = [1]([2]) activeUsers
Drag options to blanks, or click blank then click option'
Aredis.call
BSCARD
Cget
DSET
Attempts:
3 left
💡 Hint
Common Mistakes
Using get which is for strings, not sets.
Using SET which is for setting values, not getting size.
5fill in blank
hard

Fill all three blanks to write a Lua script that returns the size of the set given by the first key argument.

Redis
return [1]([2], [3][1])
Drag options to blanks, or click blank then click option'
Aredis.call
BKEYS
CSCARD
DARGV
Attempts:
3 left
💡 Hint
Common Mistakes
Using ARGV instead of KEYS for keys.
Using get instead of SCARD.