The TairZSET data structure allows you to sort data of the DOUBLE type from different dimensions. It is ideal for sorting and ranking data for use in industries such as gaming, live streaming, music, and e-commerce. This data structure improves the data processing efficiency and is also easy to implement on the client side without the need to encode, decode, or encapsulate the data.

Prerequisites

Introduction to TairZSET

The Redis Sorted Set, also known as ZSET, sorts scores based on the values of one column of the DOUBLE type, which makes it hard to implement multidimensional sorting. For example, you can implement multidimensional sorting by using the IEEE Standard for Floating-Point Arithmetic (IEEE 754) and merging data. However, this method is complex, relatively inaccurate, and disallows the ZINCRBY command.

Alibaba Cloud developed the TairZSET command to solve these issues and implement multidimensional sorting. Compared with the traditional method to implement multidimensional sorting, TairZSET provides the following benefits:
  • Support for multidimensional sorting of DOUBLE type data. The scores are sorted from left to right based on their priorities.
  • Support for the ZINCRBY command. You no longer need to retrieve current data, apply the increments to the data, and then write the data into Redis databases.
  • Support for API operations similar to those available for the native Redis ZSET.
  • Easy to implement on the client side without the need to encode, decode, or encapsulate the data.

Typical scenarios

TairZSET is ideal for sorting and ranking data for use in industries such as gaming, live streaming, music, and e-commerce. The following section lists some examples:

  • Ranking boards for the live streaming industry: In live matches, commentators are sorted by their current popularity value. If the popularity value is the same, they are sorted by the number of likes that they receive. If the number of likes is also the same, they are sorted by the value of gifts that they receive.
  • Ranking boards for achievements: Participants are sorted by the number of gold, silver, and bronze achievements that they win. If the number of gold achievements is the same, they are sorted by the number of silver achievements that they win. If the number of silver achievements is also the same, they are sorted by the number of bronze achievements that they win.
  • Ranking boards for the gaming industry: Players are sorted based on multiple factors, including their scores, task completion speeds, and achievement levels.

TairZSET commands

Command Syntax Description
EXZADD EXZADD key [NX|XX] [CH] [INCR] score member [score member ...] Stores a specified score and member information in a TairZSET key. You can specify multiple scores and members.
Note If you want to implement multidimensional sorting, you can separate the scores of each dimension with a number sign (#), such as 111#222#121. The scores of all members of a key must be in the same format.
EXZINCRBY EXZINCRBY key increment member Increases the score of a member of a TairZSET key. increment indicates the value that you want to add to the score.
EXZSCORE EXZSCORE key member Returns the score of a member of a TairZSET key. If the key or the member in the key does not exist, nil is returned.
EXZRANGE EXZRANGE <key> <min> <max> [WITHSCORES] Returns the elements of a TairZSET key within a specified score range.
EXZREVRANGE EXZREVRANGE <key> <min> <max> [WITHSCORES] Returns the elements of a TairZSET key within a specified score range. The elements are sorted by score in descending order, and the elements with the same score are sorted in reverse lexicographical order.
Note This command is similar to EXZRANGE except that this command sorts the results in reverse.
EXZRANGEBYSCORE EXZRANGEBYSCORE <key> <min> <max> [WITHSCORES] [LIMIT offset count] Returns the elements of a TairZSET key whose scores are greater than or equal to the min value and are less than or equal to the max value. The returned elements are sorted by score in ascending order. Elements with the same score are returned in lexicographical order.
EXZREVRANGEBYSCORE EXZREVRANGEBYSCORE <key> <max> <min> [WITHSCORES] [LIMIT offset count] Returns the elements of a TairZSET key whose scores are greater than or equal to the min value and are less than or equal to the max value. Contrary to the default sorting of elements in TairZSET, this command returns elements sorted by score in descending order. Elements with the same score are sorted in reverse lexicographical order.
Note This command is similar to EXZRANGEBYSCORE except that this command sorts the results in reverse and places max in front of min.
EXZRANGEBYLEX EXZRANGEBYLEX <key> <min> <max> [LIMIT offset count] To ensure that elements are sorted in lexicographical order, when all elements of a key have the same score, this command returns the elements whose scores are between the min value and the max value.
EXZREVRANGEBYLEX EXZREVRANGEBYLEX <key> <max> <min> [LIMIT offset count] To ensure that elements are sorted in lexicographical order, when all elements of a key have the same score, this command returns the elements whose scores are between the min value and the max value.
Note This command is similar to EXZRANGEBYLEX except that this command sorts the results in reverse and places max in front of min.
EXZREM EXZREM key member [member ...] Removes specified members from a TairZSET key. If a specified member does not exist, the member is ignored.
EXZREMRANGEBYSCORE EXZREMRANGEBYSCORE key min max Removes the elements from a TairZSET key whose scores are greater than or equal to the min value and are less than or equal to the max value.
EXZREMRANGEBYRANK EXZREMRANGEBYRANK key start stop Removes the elements from a TairZSET key whose ranks are within the range of the start value and the stop value.
EXZREMRANGEBYLEX EXZREMRANGEBYLEX key min max To ensure that elements are sorted in lexicographical order, when all elements of a key have the same score, this command returns the elements whose scores are between the min value and the max value.
Note If this command and the EXZRANGEBYLEX command are run by using the same min and max values, the elements removed by this command are the same as those returned by the EXZRANGEBYLEX command.
EXZCARD EXZCARD key Returns the cardinality of a TairZSET key. Cardinality is defined as the number of elements in a key.
EXZRANK EXZRANK key member Returns the rank of a member of a TairZSET key. Ranks are sorted by score in ascending order. Rank uses a zero-based numbering scheme, which indicates that the rank of the member that has the lowest score is 0. Rank is also known as index.
EXZREVRANK EXZREVRANK key member Returns the rank of a member of a TairZSET key. The returned results are sorted by score in descending order. Rank uses a zero-based numbering scheme, which indicates that the rank of the member that has the highest score is 0. Rank is also known as index.
Note This command is similar to EXZRANK except that this command sorts the results in reverse.
EXZCOUNT EXZCOUNT key min max Returns the number of elements of a TairZSET key whose scores are between the min value and the max value.
EXZLEXCOUNT EXZLEXCOUNT key min max To ensure that elements are sorted in lexicographical order, when all elements of a key have the same score, this command returns the number of elements whose values are between the min value and the max value.

EXZADD

Item Description
Syntax EXZADD key [NX|XX] [CH] [INCR] score member [score member ...]
Time complexity O(N)
Command description Adds a specified member with a specified score to a TairZSET key. You can specify multiple scores and members. The system uses different strategies based on whether the key and member exist:
Note If you want to implement multidimensional sorting, you can separate the scores of each dimension with a number sign (#), such as 111#222#121. The scores of all members of a key must be in the same format.
  • If the specified key exists but its data structure is not TairZSET, an error is returned.
  • If the specified key does not exist, the system creates a TairZSET key and adds the specified member to the key.
  • If the specified member is already a member of TairZSET, the score of the member is updated and the member is reinserted into the right position to avoid disrupting the sorting.
  • Each score is represented by a string of double-precision floating-point numbers. The +inf and -inf values are valid values.
Option
  • NX: This command adds only new elements and does not update existing elements.
  • XX: This command updates only existing elements and does not add new elements.
  • CH: In most cases, the return value of this command is the number of new elements added. You can use this option to change the return value to the total number of elements that have changed.
    Note Changed elements include new elements and existing elements with updated scores. If the score of an existing element in the command line does not change, the element is not counted as a changed element.
  • INCR: When this option is specified, EXZADD acts similarly to EXZINCRBY, which indicates that only one pair of score and element can be specified in this mode.
Return value The return value is an integer. The following rules describe the return value:
  • If no options are specified, the return value is the number of elements added to a TairZSET key.
  • If the CH option is specified, the return value is the number of elements that have changed (elements that have been added or updated).
  • If the INCR option is specified, the command returns the new score of the member as a string. If multidimensional scores are used, the scores are returned in the "score 1# score 2# score 3#..." format, such as 2#0#6.
    Note If this command is stopped beacuse the XX or NX option is included in this command, nil is returned.
Example
Sample command:
EXZADD testkey NX 1#0#3 a 1#0#2 b
Sample response:
(integer) 2

EXZINCRBY

Item Description
Syntax EXZINCRBY key increment member
Time complexity O(log(N))
Command description Increases the score of a member of a TairZSET key. increment indicates the value that you want to add to the score. The system uses different strategies based on whether the key and member exist:
  • If the specified key exists but its data structure is not TairZSET, an error is returned.
  • If the specified key does not exist, the system creates a TairZSET key and uses the specified member as the only member of the key.
  • If the specified key has no member, the system adds a member whose score is the increment value to the key, which indicates that the original score of the member is assumed to be 0.0.
Note
  • If you want to implement multidimensional sorting, you can separate the scores of each dimension with a number sign (#), such as 111#222#121. The scores of all members of a key must be in the same format.
  • The score value is a string of numeric values and can be a double-precision floating-point number. If you want to lower the score of a member, specify a negative number.
Option None
Return value The new score of a member as a string. If multidimensional scores are used, the scores are returned in the "score 1# score 2# score 3#..." format, such as 2#0#6.
Example

Sample command:

EXZINCRBY testkey 2#2#1 a

Sample response:

"3#2#4"

EXZSCORE

Item Description
Syntax EXZSCORE key member
Time complexity O(1)
Command description Returns the score of a member of a TairZSET key. If the key or the member in the key does not exist, nil is returned.
Option None
Return value The score of a member as a string. If multidimensional scores are used, the scores are returned in the "score 1# score 2# score 3#..." format, such as 2#0#6.
Example

Sample command:

EXZSCORE testkey a

Sample response:

"3#2#4"

EXZRANGE

Item Description
Syntax EXZRANGE <key> <min> <max> [WITHSCORES]
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements returned.
Command description Returns the elements of a TairZSET key within a specified score range.
Option
  • min and max: indicate zero-based indexes, where 0 is the first element, and 1 is the next element. Other elements follow the same rule. You can use these two options to specify a closed interval.
    Note
    • The indexes can also be negative numbers, which indicate offsets from the end of TairZSET members returned. For example, -1 indicates the last element of a key, and -2 indicates the penultimate element of a key. Other elements follow the same rule.
    • To query all elements, you can set min to 0 and max to -1.
    • If the min value is greater than the index of the last element of a key or the max value, an empty list is returned.
  • WITHSCORES: returns the scores of elements. The scores are returned in the value 1 , score 1,..., value N, score N format. Example:
    1) "b"
    2) "1#0#2"
    3) "a"
    4) "3#2#4"
Return value A list of elements within a specified score range. If the WITHSCORES option is specified, the scores of elements are returned.
Example

Sample command:

EXZRANGE testkey 0 -1 WITHSCORES

Sample response:

1) "b"
2) "1#0#2"
3) "a"
4) "3#2#4"

EXZREVRANGE

Item Description
Syntax EXZREVRANGE <key> <min> <max> [WITHSCORES]
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements returned.
Command description Returns the elements of a TairZSET key within a specified score range. The elements are sorted by score in descending order, and the elements with the same score are sorted in reverse lexicographical order.
Note This command is similar to EXZRANGE except that this command sorts the results in reverse.
Option
  • min and max: indicate zero-based indexes, where 0 is the first element, and 1 is the next element. Other elements follow the same rule. You can use these two options to specify a closed interval.
    Note
    • The indexes can also be negative numbers, which indicate offsets from the end of TairZSET members returned. For example, -1 indicates the last element of a key, and -2 indicates the penultimate element of a key. Other elements follow the same rule.
    • To query all elements, you can set min to 0 and max to -1.
    • If the min value is greater than the index of the last element of a key or the max value, an empty list is returned.
  • WITHSCORES: returns the scores of elements. The scores are returned in the value 1 , score 1,..., value N, score N format. Example:
    1) "b"
    2) "1#0#2"
    3) "a"
    4) "3#2#4"
Return value

A list of elements within a specified score range. If the WITHSCORES option is specified, the scores of elements are returned.

Example

Sample command:

EXZREVRANGE testkey 0 -1 WITHSCORES

Sample response:

1) "a"
2) "3#2#4"
3) "b"
4) "1#0#2"

EXZRANGEBYSCORE

Item Description
Syntax EXZRANGEBYSCORE <key> <min> <max> [WITHSCORES] [LIMIT offset count]
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements returned.
Note When M is set to a constant, this algorithm can be regarded as O(log(N)). For example, you specify that the first 10 elements are always returned by using the LIMIT offset count option.
Command description Returns the elements of a TairZSET key whose scores are greater than or equal to the min value and are less than or equal to the max value. The returned elements are sorted by score in ascending order. Elements with the same score are returned in lexicographical order.
Option
  • min and max: indicate the lowest score and the highest score. If multidimensional scores are used, scores of each dimension are separated by a number sign (#).
    Note
    • If you are not sure about the highest and lowest element scores of a key and you want to query elements whose scores are greater than or equal to or are less than or equal to a specific value, set min to negative infinity (-inf) and max to positive infinity (+inf).
    • The default data range is a closed interval. To specify an open interval, add an parenthesis before the score range. For example, EXZRANGEBYSCORE zset (1 5 indicates that elements whose scores are greater than 1 and are less than or equal to 5 are returned.
  • WITHSCORES: returns the scores of elements.
  • LIMIT offset count: specifies the number and interval of the returned results of a key. If the count value is negative, all elements that start from offset are returned.
    Note If the offset value is large, the key needs to be traversed to identify offset elements before elements are returned. This increases time complexity.
Return value

A list of elements within a specified score range. If the WITHSCORES option is specified, the scores of elements are returned.

Example

Sample command:

EXZRANGEBYSCORE testkey 0#0#0 6#6#6 WITHSCORES

Sample response:

1) "b"
2) "1#0#2"
3) "a"
4) "3#2#4"

EXZREVRANGEBYSCORE

Item Description
Syntax EXZREVRANGEBYSCORE <key> <max> <min> [WITHSCORES] [LIMIT offset count]
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements returned.
Note When M is set to a constant, this algorithm can be regarded as O(log(N)). For example, you specify that the first 10 elements are always returned by using the LIMIT offset count option.
Command description Returns the elements of a TairZSET key whose scores are greater than or equal to the min value and are less than or equal to the max value. Contrary to the default sorting of elements in TairZSET, this command returns elements sorted by score in descending order. Elements with the same score are sorted in reverse lexicographical order.
Note This command is similar to EXZRANGEBYSCORE except that this command sorts the results in reverse and places max in front of min.
Option
  • min and max: indicate the lowest score and the highest score. If multidimensional scores are used, scores of each dimension are separated by a number sign (#).
    Note
    • If you are not sure about the highest and lowest element scores of a key and you want to query elements whose scores are greater than or equal to or are less than or equal to a specific value, set min to negative infinity (-inf) and max to positive infinity (+inf).
    • The default data range is a closed interval. To specify an open interval, add an parenthesis before the score range. For example, EXZRANGEBYSCORE zset (1 5 indicates that elements whose scores are greater than 1 and are less than or equal to 5 are returned.
  • WITHSCORES: returns the scores of elements.
  • LIMIT offset count: specifies the number and interval of the returned results of a key. If the count value is negative, all elements that start from offset are returned.
    Note If the offset value is large, the key needs to be traversed to identify offset elements before elements are returned. This increases time complexity.
Return value

A list of elements within a specified score range. If the WITHSCORES option is specified, the scores of elements are returned.

Example

Sample command:

EXZREVRANGEBYSCORE testkey 6#6#6 0#0#0

Sample response:

1) "a"
2) "3#2#4"
3) "b"
4) "1#0#2"

EXZRANGEBYLEX

Item Description
Syntax EXZRANGEBYLEX <key> <min> <max> [LIMIT offset count]
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements returned.
Note When M is set to a constant, this algorithm can be regarded as O(log(N)). For example, you specify that the first 10 elements are always returned by using the LIMIT offset count option.
Command description To ensure that elements are sorted in lexicographical order, when all elements of a key have the same score, this command returns the elements whose scores are between the min value and the max value.
Note
  • If the elements of a key have different scores, the returned elements are unknown.
  • You can use the memcmp() C function to compare two string elements byte-by-byte. Elements are sorted in ascending order based on the preceding comparison. If two strings contain the same substring, the longer string is assigned a greater value than the shorter string.
Option
  • min and max: indicate the minimum and the maximum string representation values of the member name. You must specify the intervals of characters. The following section shows how to specify intervals:
    • Open interval: Add a parenthesis to the front of a value, such as (a.
    • Closed interval: Add a bracket to the front of a value, such as [a.
    Note + indicates positive infinity, and - indicates negative infinity.
  • LIMIT offset count: specifies the number and interval of the returned results of a key. If the count value is negative, all elements that start from offset are returned.
    Note If the offset value is large, the key needs to be traversed to identify offset elements before elements are returned. This increases time complexity.
Return value A list of elements within a specified score range.
Example

Sample command:

EXZRANGEBYLEX zzz [a [b

Sample response:

1) "aba"
2) "abc"

EXZREVRANGEBYLEX

Item Description
Syntax EXZREVRANGEBYLEX <key> <max> <min> [LIMIT offset count]
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements returned.
Note When M is set to a constant, this algorithm can be regarded as O(log(N)). For example, you specify that the first 10 elements are always returned by using the LIMIT offset count option.
Command description To ensure that elements are sorted in lexicographical order, when all elements of a key have the same score, this command returns the elements whose scores are between the min value and the max value.
Note This command is similar to EXZRANGEBYLEX except that this command sorts the results in reverse and places max in front of min.
Option
  • min and max: indicate the minimum and the maximum string representation values of the member name. You must specify the intervals of characters. The following section shows how to specify intervals:
    • Open interval: Add a parenthesis to the front of a value, such as (a.
    • Closed interval: Add a bracket to the front of a value, such as [a.
    Note + indicates positive infinity, and - indicates negative infinity.
  • LIMIT offset count: specifies the number and interval of the returned results of a key. If the count value is negative, all elements that start from offset are returned.
    Note If the offset value is large, the key needs to be traversed to identify offset elements before elements are returned. This increases time complexity.
Return value A list of elements within a specified score range.
Example

Sample command:

EXZREVRANGEBYLEX zzz [b [a

Sample response:

1) "abc"
2) "aba"

EXZREM

Item Description
Syntax EXZREM key member [member ...]
Time complexity O(M*log(N)), where N indicates the number of elements in TairZSET, and M indicates the number of elements to be removed.
Command description Removes specified members from a TairZSET key. If a specified member does not exist, the member is ignored.
Note If the specified key exists but its data structure is not TairZSET, an error is returned.
Option None
Return value The number of members removed from the key. The members that do not exist are not included.
Example

Sample command:

EXZREM testkey a

Sample response:

(integer) 1

EXZREMRANGEBYSCORE

Item Description
Syntax EXZREMRANGEBYSCORE key min max
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements to be removed.
Command description Removes the elements from a TairZSET key whose scores are greater than or equal to the min value and are less than or equal to the max value.
Option min and max: indicate the lowest score and the highest score. If multidimensional scores are used, scores of each dimension are separated by a number sign (#).
Note
  • If you are not sure about the highest and lowest element scores of a key and you want to query elements whose scores are greater than or equal to or are less than or equal to a specific value, set min to negative infinity and max to positive infinity.
  • The default data range is a closed interval. To specify an open interval, add a parenthesis before the score range. For example, EXZREMRANGEBYSCORE (1 5 indicates that elements whose scores are greater than 1 and are less than or equal to 5 are returned.
Return value The number of elements removed.
Example

Sample command:

EXZREMRANGEBYSCORE testkey 3#2#4 6#6#6

Sample response:

(integer) 1

EXZREMRANGEBYRANK

Item Description
Syntax EXZREMRANGEBYRANK key start stop
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements removed.
Command description Removes the elements from a TairZSET key whose ranks are within the range of the start value and the stop value.
Option Both start and stop indicate zero-based indexes. 0 indicates the element that has the lowest score. These indexes can be negative numbers. These numbers indicate offsets that start at the element that has the highest score. For example, -1 indicates the element that has the highest score, and -2 indicates the element that has the second highest score. Other elements follow the same rule.
Return value The number of elements removed.
Example

Sample command:

EXZREMRANGEBYRANK testkey 0 1

Sample response:

(integer) 1

EXZREMRANGEBYLEX

Item Description
Syntax EXZREMRANGEBYLEX key min max
Time complexity O(log(N)+M), where N indicates the number of elements in TairZSET, and M indicates the number of elements removed.
Command description To ensure that elements are sorted in lexicographical order, when all elements of a key have the same score, this command returns the elements whose scores are between the min value and the max value.
Note If this command and the EXZRANGEBYLEX command are run by using the same min and max values, the elements removed by this command are the same as those returned by the EXZRANGEBYLEX command.
Option min and max: indicate the minimum and the maximum string representation values of the member name. You must specify the intervals of characters. The following section shows how to specify intervals:
  • Open interval: Add a parenthesis to the front of a value, such as (a.
  • Closed interval: Add a bracket to the front of a value, such as [a.
Return value The number of elements removed.
Example

Sample command:

EXZREMRANGEBYLEX [a [b

Sample response:

(integer) 2

EXZCARD

Item Description
Syntax EXZCARD key
Time complexity O(1)
Command description Returns the cardinality of a TairZSET key. Cardinality is defined as the number of elements in a key.
Option None
Return value The number of elements of a TairZSET key. If the key does not exist, 0 is returned.
Example

Sample command:

EXZCARD testkey

Sample response:

(integer) 2

EXZRANK

Item Description
Syntax EXZRANK key member
Time complexity O(log(N))
Command description Returns the rank of a member of a TairZSET key. Ranks are sorted by score in ascending order. Rank uses a zero-based numbering scheme, which indicates that the rank of the member that has the lowest score is 0. Rank is also known as index.
Option None
Return value
  • If the specified member exists, the integer rank of the member is returned.
  • If the key or the member in the key does not exist, nil is returned.
Example

Sample command:

EXZRANK testkey b

Sample response:

(integer) 0

EXZREVRANK

Item Description
Syntax EXZREVRANK key member
Time complexity O(log(N))
Command description Returns the rank of a member of a TairZSET key. The returned results are sorted by score in descending order. Rank uses a zero-based numbering scheme, which indicates that the rank of the member that has the highest score is 0. Rank is also known as index.
Note This command is similar to EXZRANK except that this command sorts the results in reverse.
Option None
Return value
  • If the specified member exists, the integer rank of the member is returned.
  • If the key or the member in the key does not exist, nil is returned.
Example

Sample command:

EXZREVRANK testkey b

Sample response:

(integer) 1

EXZCOUNT

Item Description
Syntax EXZCOUNT key min max
Time complexity O(log(N)), where N indicates the number of elements in TairZSET.
Note This command uses element ranks to obtain the query range. Therefore, the workloads associated with this command are not proportional to the size of the range.
Command description Returns the number of elements of a TairZSET key whose scores are between the min value and the max value.
Option min and max: indicate the lowest score and the highest score. If multidimensional scores are used, scores of each dimension are separated by a number sign (#).
Note
  • If you are not sure about the highest and lowest element scores of a key and you want to query elements whose scores are greater than or equal to or are less than or equal to a specific value, set min to negative infinity and max to positive infinity.
  • The default data range is a closed interval. To specify an open interval, add a parenthesis before the score range. For example, EXZRANGEBYSCORE zset (1 5 indicates that elements whose scores are greater than 1 and are less than or equal to 5 are returned.
Return value The integer number of elements within a specified score range.
Example

Sample command:

EXZCOUNT testkey (1#0#2 6#6#6

Sample response:

(integer) 1

EXZLEXCOUNT

Item Description
Syntax EXZLEXCOUNT key min max
Time complexity O(log(N)), where N indicates the number of elements in TairZSET.
Note This command uses element ranks to obtain the query range. Therefore, the workloads associated with this command are not proportional to the size of the range.
Command description To ensure that elements are sorted in lexicographical order, when all elements of a key have the same score, this command returns the number of elements whose values are between the min value and the max value.
Note
  • If the elements of a key have different scores, the returned elements are unknown.
  • You can use the memcmp() C function to compare two string elements byte-by-byte. Elements are sorted in ascending order based on the preceding comparison. If two strings contain the same substring, the longer string is assigned a greater value than the shorter string.
Option min and max: indicate the minimum and the maximum string representation values of the member name. You must specify the intervals of characters. The following section shows how to specify intervals:
  • Open interval: Add a parenthesis to the front of a value, such as (a.
  • Closed interval: Add a bracket to the front of a value, such as [a.
Return value The integer number of elements within a specified score range.
Example

Sample command:

EXZLEXCOUNT zzz [a [b

Sample response:

(integer) 2