View Source Comtile38 (Comtile38 v0.0.1)

Entry point module of the library with all Tile38 commands functions.

The functions defined here are loaded in compile time from the Tile38 commands documentation The only exceptions are commands/0, command_group/1 and command_groups/0 that provide a way to look for the desired commands. Because you don't need to remember all of them by heart

Link to this section Summary

Functions

Downloads the AOF starting from pos and keeps the connection alive

Performs a checksum on a portion of the aof

Shrinks the aof in the background

Authenticate to the server

Get the combined bounds of all the objects in a key

Finds all channels matching a pattern

Returns the commands in the given command group.

Returns the names of the command groups provided by Redis.

Returns the list of all available commands.

Get the value of a configuration parameter

Rewrite the configuration file with the in memory configuration

Set a configuration parameter to the given value

Delete an id from a key

Removes a channel

Removes a webhook

Remove a key from the database

Evaluates a Lua script

Evaluates a Lua script in a non-atomic fashion

Evaluates, in a non-atomic fashion, a Lua script cached on the server by its SHA1 digest

Evaluates a read-only Lua script

Evaluates a read-only Lua script cached on the server by its SHA1 digest

Evaluates a Lua script cached on the server by its SHA1 digest

Set a timeout on an id

Removes all keys

Follows a leader host

Set the value for one or more fields of an id

Forces a garbage collection

Get the object of an id

Finds all hooks matching a pattern

Searches for ids that intersect an area

Delete a value from a JSON document

Get a value from a JSON document

Set a value in a JSON document

Finds all keys matching the given pattern

Searches for ids that are nearby a point

Gets or sets the output format for the current connection.

Removes all objects matching a pattern

Removes all channels matching a pattern

Removes all hooks matching a pattern

Remove the existing timeout on an id

Ping the server

Subscribes the client to the given patterns

Close the connection

Turns on or off readonly mode

Rename a key to be stored under a different name.

Rename a key to be stored under a different name, if a new key does not exist.

Incrementally iterate though a key

Returns information about the existence of the scripts in server cache

Flushes the server cache of Lua scripts

Loads the compiled version of a script into the server cache, without executing

Search for string values in a key

Show server stats and details

Sets the value of an id

Creates a pubsub channel which points to geofenced search

Creates a webhook which points to geofenced search

Show stats for one or more keys

Subscribe to a geofence channel

Performs spatial test

Runs the following command with the timeout

Get a timeout on an id

Searches for ids that completely within the area

Link to this section Functions

Downloads the AOF starting from pos and keeps the connection alive

Group: replication

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • pos integer

Performs a checksum on a portion of the aof

Group: replication

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • pos integer

  • size integer

Shrinks the aof in the background

Group: replication

Authenticate to the server

Group: connection

Arguments:

  • password string

Get the combined bounds of all the objects in a key

Group: keys

Available since version 1.3.0.

Time complexity: O(1)

Arguments:

  • key string

Finds all channels matching a pattern

Group: pubsub

Arguments:

  • pattern
@spec command_group(atom()) :: [atom()]

Returns the commands in the given command group.

@spec command_groups() :: [atom()]

Returns the names of the command groups provided by Redis.

@spec commands() :: [atom()]

Returns the list of all available commands.

Get the value of a configuration parameter

Group: server

Arguments:

  • parameter string

Rewrite the configuration file with the in memory configuration

Group: server

Link to this function

config_set(parameter, opts \\ [])

View Source

Set a configuration parameter to the given value

Group: server

Arguments:

  • parameter string

  • value optional, string

Link to this function

del(key, id, opts \\ [])

View Source

Delete an id from a key

Group: keys

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • key string

  • id string

  • erron404 optional

Removes a channel

Group: pubsub

Arguments:

  • name string

Removes a webhook

Group: webhook

Arguments:

  • name string

Remove a key from the database

Group: keys

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • key string
Link to this function

eval(script, numkeys, opts \\ [])

View Source

Evaluates a Lua script

Group: scripting

Available since version 1.10.0.

Time complexity: Depends on the evaluated script

Arguments:

  • script string

  • numkeys integer

  • key optional, multiple, string

  • arg optional, multiple, string

Link to this function

evalna(script, numkeys, opts \\ [])

View Source

Evaluates a Lua script in a non-atomic fashion

Group: scripting

Available since version 1.10.0.

Time complexity: Depends on the evaluated script

Arguments:

  • script string

  • numkeys integer

  • key optional, multiple, string

  • arg optional, multiple, string

Link to this function

evalnasha(sha1, numkeys, opts \\ [])

View Source

Evaluates, in a non-atomic fashion, a Lua script cached on the server by its SHA1 digest

Group: scripting

Available since version 1.10.0.

Time complexity: Depends on the evaluated script

Arguments:

  • sha1 string

  • numkeys integer

  • key optional, multiple, string

  • arg optional, multiple, string

Link to this function

evalro(script, numkeys, opts \\ [])

View Source

Evaluates a read-only Lua script

Group: scripting

Available since version 1.10.0.

Time complexity: Depends on the evaluated script

Arguments:

  • script string

  • numkeys integer

  • key optional, multiple, string

  • arg optional, multiple, string

Link to this function

evalrosha(script, numkeys, opts \\ [])

View Source

Evaluates a read-only Lua script cached on the server by its SHA1 digest

Group: scripting

Available since version 1.10.0.

Time complexity: Depends on the evaluated script

Arguments:

  • script string

  • numkeys integer

  • key optional, multiple, string

  • arg optional, multiple, string

Link to this function

evalsha(sha1, numkeys, opts \\ [])

View Source

Evaluates a Lua script cached on the server by its SHA1 digest

Group: scripting

Available since version 1.10.0.

Time complexity: Depends on the evaluated script

Arguments:

  • sha1 string

  • numkeys integer

  • key optional, multiple, string

  • arg optional, multiple, string

Link to this function

expire(key, id, seconds)

View Source

Set a timeout on an id

Group: keys

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • key string

  • id string

  • seconds double

Removes all keys

Group: server

Available since version 1.0.0.

Time complexity: O(1)

Follows a leader host

Group: replication

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • host string

  • port integer

Link to this function

fset(key, id, field_value, opts \\ [])

View Source

Set the value for one or more fields of an id

Group: keys

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • key string

  • id string

  • xx optional

  • field_value [string, double]

  • field_value optional, multiple, [string, double]

Forces a garbage collection

Group: server

Available since version 1.0.0.

Time complexity: O(1)

Link to this function

get(key, id, opts \\ [])

View Source

Get the object of an id

Group: keys

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • key string

  • id string

  • withfields optional

  • type optional

Finds all hooks matching a pattern

Group: webhook

Arguments:

  • pattern
Link to this function

intersects(key, area, opts \\ [])

View Source

Searches for ids that intersect an area

Group: search

Available since version 1.0.0.

Time complexity: O(log(N)) where N is the number of ids in the area

Arguments:

  • key string

  • cursor optional, integer

  • limit optional, integer

  • match optional

  • where optional, multiple, [string, double, double]

  • wherein optional, multiple, [string, integer, double]

  • whereeval optional, multiple, [string, integer, string]

  • whereevalsha optional, multiple, [string, integer, string]

  • clip optional

  • nofields optional

  • fence optional

  • detect optional, [string]

  • commands optional, [string]

  • type optional

  • area

Delete a value from a JSON document

Group: keys

Time complexity: O(1)

Arguments:

  • key string

  • id string

  • path string

Link to this function

jget(key, id, path, opts \\ [])

View Source

Get a value from a JSON document

Group: keys

Time complexity: O(1)

Arguments:

  • key string

  • id string

  • path string

  • raw optional

Link to this function

jset(key, id, path, value, opts \\ [])

View Source

Set a value in a JSON document

Group: keys

Time complexity: O(1)

Arguments:

  • key string

  • id string

  • path string

  • value string

  • `` optional

Finds all keys matching the given pattern

Group: keys

Available since version 1.0.0.

Time complexity: O(N) where N is the number of keys in the database

Arguments:

  • pattern
Link to this function

nearby(key, area, opts \\ [])

View Source

Searches for ids that are nearby a point

Group: search

Available since version 1.0.0.

Time complexity: O(log(N)) where N is the number of ids in the area

Arguments:

  • key string

  • cursor optional, integer

  • limit optional, integer

  • match optional

  • distance optional

  • where optional, multiple, [string, double, double]

  • wherein optional, multiple, [string, integer, double]

  • whereeval optional, multiple, [string, integer, string]

  • whereevalsha optional, multiple, [string, integer, string]

  • nofields optional

  • fence optional

  • detect optional, [string]

  • commands optional, [string]

  • type optional

  • area

Gets or sets the output format for the current connection.

Group: connection

Arguments:

  • format optional

Removes all objects matching a pattern

Group: keys

Arguments:

  • key string

  • pattern

Removes all channels matching a pattern

Group: pubsub

Arguments:

  • pattern

Removes all hooks matching a pattern

Group: webhook

Arguments:

  • pattern

Remove the existing timeout on an id

Group: keys

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • key string

  • id string

Ping the server

Group: connection

Subscribes the client to the given patterns

Group: pubsub

Arguments:

  • pattern

Close the connection

Group: connection

Turns on or off readonly mode

Group: server

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • `` ["yes", "no"]

Rename a key to be stored under a different name.

Group: keys

Available since version 1.14.5.

Time complexity: O(1)

Arguments:

  • key string

  • newkey string

Rename a key to be stored under a different name, if a new key does not exist.

Group: keys

Available since version 1.14.5.

Time complexity: O(1)

Arguments:

  • key string

  • newkey string

Incrementally iterate though a key

Group: search

Available since version 1.0.0.

Time complexity: O(N) where N is the number of ids in the key

Arguments:

  • key string

  • cursor optional, integer

  • limit optional, integer

  • match optional

  • order optional

  • where optional, multiple, [string, double, double]

  • wherein optional, multiple, [string, integer, double]

  • whereeval optional, multiple, [string, integer, string]

  • whereevalsha optional, multiple, [string, integer, string]

  • nofields optional

  • type optional

Returns information about the existence of the scripts in server cache

Group: scripting

Available since version 1.10.0.

Time complexity: O(N) where N is the number of provided sha1 arguments

Arguments:

  • sha1 multiple, string

Flushes the server cache of Lua scripts

Group: scripting

Available since version 1.10.0.

Time complexity: O(1)

Loads the compiled version of a script into the server cache, without executing

Group: scripting

Available since version 1.10.0.

Time complexity: O(N) where N is the number of bytes in the script

Arguments:

  • script string

Search for string values in a key

Group: search

Available since version 1.4.2.

Time complexity: O(N) where N is the number of values in the key

Arguments:

  • key string

  • cursor optional, integer

  • limit optional, integer

  • match optional

  • order optional

  • where optional, multiple, [string, double, double]

  • wherein optional, multiple, [string, integer, double]

  • whereeval optional, multiple, [string, integer, string]

  • whereevalsha optional, multiple, [string, integer, string]

  • nofields optional

  • type optional

Show server stats and details

Group: server

Available since version 1.0.0.

Time complexity: O(1)

Link to this function

set(key, id, value, opts \\ [])

View Source

Sets the value of an id

Group: keys

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • key string

  • id string

  • field optional, multiple, [string, double]

  • ex optional, [double]

  • type optional

  • value

Link to this function

setchan(name, nil, key, param, opts \\ [])

View Source

Creates a pubsub channel which points to geofenced search

Group: pubsub

Arguments:

  • name string

  • meta optional, multiple, [string, string]

  • ex optional, [double]

  • ` ["NEARBY", "WITHIN", "INTERSECTS"] *keystring *fence*detectoptional, [string] *commandsoptional, [string] *param` string

Link to this function

sethook(name, endpoint, nil, key, param, opts \\ [])

View Source

Creates a webhook which points to geofenced search

Group: webhook

Arguments:

  • name string

  • endpoint string

  • meta optional, multiple, [string, string]

  • ex optional, [double]

  • ` ["NEARBY", "WITHIN", "INTERSECTS"] *keystring *fence*detectoptional, [string] *commandsoptional, [string] *param` string

Show stats for one or more keys

Group: keys

Available since version 1.0.0.

Time complexity: O(N) where N is the number of keys being requested

Arguments:

  • key string

Subscribe to a geofence channel

Group: pubsub

Arguments:

  • channel string
Link to this function

test(area1, test, area2, opts \\ [])

View Source

Performs spatial test

Group: tests

Available since version 1.16.0.

Time complexity: One test per command, complexity depends on the test

Arguments:

  • area1

  • test

  • clip optional

  • area2

Link to this function

timeout(seconds, command, opts \\ [])

View Source

Runs the following command with the timeout

Group: connection

Arguments:

  • seconds double

  • command string

  • arg optional, multiple, string

Get a timeout on an id

Group: keys

Available since version 1.0.0.

Time complexity: O(1)

Arguments:

  • key string

  • id string

Link to this function

within(key, area, opts \\ [])

View Source

Searches for ids that completely within the area

Group: search

Available since version 1.0.0.

Time complexity: O(log(N)) where N is the number of ids in the area

Arguments:

  • key string

  • cursor optional, integer

  • limit optional, integer

  • match optional

  • where optional, multiple, [string, double, double]

  • wherein optional, multiple, [string, integer, double]

  • whereeval optional, multiple, [string, integer, string]

  • whereevalsha optional, multiple, [string, integer, string]

  • nofields optional

  • fence optional

  • detect optional, [string]

  • commands optional, [string]

  • type optional

  • area