vibe.d beta banner
get vibe.d
0.8.2

Asynchronous I/O that doesn’t get in your way, written in D

Struct RedisDatabase

Accesses the contents of a Redis database

struct RedisDatabase ;

Properties

NameTypeDescription
client[get]inout(RedisClient)The Redis client with which the database is accessed.
index[get]longIndex of the database.

Methods

NameDescription
dbSizeReturn the number of keys in the selected database
decrDecrement the integer value of a key by one
delDelete a key
deleteAllDeletes all keys of the database.
existsDetermine if a key exists
expireSet a key's time to live in seconds
expireSet a key's time to live with D notation. E.g. 5.minutes for 60 * 5 seconds.
expireAtSet the expiration for a key as a UNIX timestamp
getBitReturns the bit value at offset in the string value stored at key
hdelDelete one or more hash fields
hexistsDetermine if a hash field exists
hincrIncrement the real number value of a hash field
hincrIncrement the integer value of a hash field
hlenGet the number of fields in a hash
incrIncrement the real number value of a key
incrIncrement the integer value of a key
llenReturns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned.
ltrimTrim an existing list so that it will contain only the specified range of elements specified.
moveMove a key to another database
persistRemove the expiration from a key
pttlGet the time to live for a key in milliseconds
publishPublishes a message to all clients subscribed at the channel
randomKeyReturn a random key from the keyspace
renameRename a key
renameNXRename a key, only if the new key does not exist
scardReturns the set cardinality (number of elements) of the set stored at key.
scriptLoadLoad a script into the scripts cache, without executing it. Run it using evalSHA.
sdiffStoreThis command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.
setBitSets or clears the bit at offset in the string value stored at key
sinterStoreThis command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.
strlenGet the length of the value stored in a key
sunionStoreThis command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.
ttlGet the time to live for a key
typeDetermine the type stored at key (string, list, set, zset and hash.)
zcardReturns the sorted set cardinality (number of elements) of the sorted set stored at key.
zremRangeByRankRemoves all elements in the sorted set stored at key with rank between start and stop.

Aliases

NameDescription
Zcard

Templates

NameDescription
appendAppend a value to a key
blpopBLPOP is a blocking list pop primitive. It is the blocking version of LPOP because it blocks
evalExecute a Lua script server side
evalSHAEvaluates a script cached on the server side by its SHA1 digest. Scripts are cached on the server side using the scriptLoad function.
getGet the value of a key
getRangeGet a substring of the string stored at a key
getSetSet the string value of a key and return its old value
hgetGet the value of a hash field.
hgetAllGet all the fields and values in a hash
hkeysGet all the fields in a hash
hmgetGet the values of all the given hash fields
hmsetSet multiple hash fields to multiple values
hmsetNXThis command does not exist in redis and must be implemented at a higher level
hsetSet multiple hash fields to multiple values
hsetNXSet the value of a hash field, only if the field does not exist
hvalsGet all the values in a hash
keysFind all keys matching the given glob-style pattern (Supported wildcards: *, ?, [ABC])
lindexGet an element from a list by its index
linsertAfterInsert value in the list stored at key after the reference value pivot.
linsertBeforeInsert value in the list stored at key before the reference value pivot.
lpopRemoves and returns the first element of the list stored at key.
lpushInsert all the specified values at the head of the list stored at key.
lpushXInserts value at the head of the list stored at key, only if key already exists and holds a list.
lrangeReturns the specified elements of the list stored at key.
lremRemoves the first count occurrences of elements equal to value from the list stored at key.
lsetSets the list element at index to value.
mgetGet the values of all the given keys
msetSet multiple keys to multiple values
msetNXSet multiple keys to multiple values, only if none of the keys exist
pubsubInspect the state of the Pub/Sub subsystem
requestRun the specified command and arguments in the Redis database server
rpopRemoves and returns the last element of the list stored at key.
rpoplpushAtomically returns and removes the last element (tail) of the list stored at source,
rpushInsert all the specified values at the tail of the list stored at key.
rpushXInserts value at the tail of the list stored at key, only if key already exists and holds a list.
saddAdd the specified members to the set stored at key. Specified members that are already a member of this set are ignored.
sdiffReturns the members of the set resulting from the difference between the first set and all the successive sets.
setSet the string value of a key
setEXSet the value and expiration of a key
setNXSet the value of a key, only if the key does not exist
setNXSet the value of a key, only if the key does not exist, and also set the specified expire time using D notation, e.g. 5.minutes for 5 minutes.
setRangeOverwrite part of a string at key starting at the specified offset
setXXSet the value of a key, only if the key already exists
setXXSet the value of a key, only if the key already exists, and also set the specified expire time using D notation, e.g. 5.minutes for 5 minutes.
sinterReturns the members of the set resulting from the intersection of all the given sets.
sisMemberReturns if member is a member of the set stored at key.
smembersReturns all the members of the set value stored at key.
smoveMove member from the set at source to the set at destination. This operation is atomic.
spopRemoves and returns a random element from the set value stored at key.
srandMemberReturns a random element from the set stored at key.
sremRemove the specified members from the set stored at key.
sunionReturns the members of the set resulting from the union of all the given sets.
zaddAdd one or more members to a sorted set, or update its score if it already exists
zcountReturns the number of elements in the sorted set at key with a score between min and max
zincrbyIncrements the score of member in the sorted set stored at key by increment.
zrangeReturns the specified range of elements in the sorted set stored at key.
zrangeByScoreReturns all the elements in the sorted set at key with a score between start and end inclusively
zrangeByScoreComputes an internal list of elements in the sorted set at key with a score between start and end inclusively,
zrankReturns the rank of member in the sorted set stored at key, with the scores ordered from low to high.
zremRemoves the specified members from the sorted set stored at key.
zremRangeByScoreRemoves all elements in the sorted set stored at key with a score between min and max (inclusive).
zrevRangeReturns the specified range of elements in the sorted set stored at key.
zrevRangeByScoreReturns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).
zrevRangeByScoreComputes an internal list of elements in the sorted set at key with a score between max and min, and
zrevRankReturns the rank of member in the sorted set stored at key, with the scores ordered from high to low.
zscoreReturns the score of member in the sorted set at key.
Authors

Jan Krüger, Sönke Ludwig, Michael Eisendle, Etienne Cimon

Copyright

© 2012-2014 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.