LGET
LGET
can be used to access the items in a list. Through the sub-actions provided by lget
, you can access multiple or individual elements in lists.
LGET
About
Time complexity: O(n)
Accept type:
Return type:
Syntax:
LGET <list>
Returns all the values contained in a the provided list, if it exists in the current table.
limit
About
Time complexity: O(n)
Accept type:
Return type:
Syntax:
LGET <list> limit <limit>
Returns a maximum of limit
values from the provided list, if it exists in the current table
len
About
Time complexity: O(1)
Accept type:
Return type:
Syntax:
LGET <list> len
Returns the length of the list
valueat
About
Time complexity: O(1)
Accept type:
Return type:
Syntax:
LGET <list> valueat <index>
Returns the element present at the provided index
, if it exists in the given list.
first
About
Time complexity: O(1)
Accept type:
Return type:
Syntax:
LGET <list> first
Returns the first element present in the list, if it exists.
last
About
Time complexity: O(1)
Accept type:
Return type:
Syntax:
LGET <list> last
Returns the last element present in the list, if it exists.
range
About
Time complexity: O(n)
Accept type:
Return type:
Syntax:
LGET <list> range <start>
LGET <list> range <start> <stop>
Returns items in the given range. If no value for stop
is provided, all the elements from that index are returned. If a value for stop
is provided, then a subarray is returned