hedis
Safe HaskellNone
LanguageHaskell2010

Database.Redis.ManualCommands.JSON

Synopsis

Documentation

jsonArrappend Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the array.

-> NonEmpty ByteString

Serialized JSON values to append.

-> m (f Reply) 

Appends one or more JSON values into the array at path after the last element in it (https://redis.io/commands/json.arrappend).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonArrindex Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the array.

-> ByteString

Serialized JSON scalar to search for.

-> m (f Reply) 

Returns the index of the first occurrence of a JSON scalar value in the array at path (https://redis.io/commands/json.arrindex).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonArrindexOpts Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the array.

-> ByteString

Serialized JSON scalar to search for.

-> JSONArrIndexOpts

Optional search range.

-> m (f Reply) 

Returns the index of the first occurrence of a JSON scalar value in the array at path (https://redis.io/commands/json.arrindex).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonArrlen Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Reply) 

Returns the length of the array at the root path (https://redis.io/commands/json.arrlen).

O(1) where path is evaluated to a single value, O(N) where path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonArrlenAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the array.

-> m (f Reply) 

Returns the length of the array at path (https://redis.io/commands/json.arrlen).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) where path is evaluated to a single value, O(N) where path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonArrinsert Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the array.

-> Integer

Insertion index.

-> NonEmpty ByteString

Serialized JSON values to insert.

-> m (f Reply) 

Inserts the JSON scalar(s) value at the specified index in the array at path (https://redis.io/commands/json.arrinsert).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonArrpop Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Reply) 

Removes and returns the element at the end of the array at the root path (https://redis.io/commands/json.arrpop).

O(1) when the popped item is the last element, otherwise O(N) where N is the size of the array

Since RedisJSON 1.0.0

jsonArrpopAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the array.

-> m (f Reply) 

Removes and returns the element at the end of the array at path (https://redis.io/commands/json.arrpop).

The reply shape depends on the path syntax and popped value type, so this wrapper returns the raw Reply.

O(1) when the popped item is the last element, otherwise O(N) where N is the size of the array

Since RedisJSON 1.0.0

jsonArrpopAtIndex Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the array.

-> Integer

Index to pop.

-> m (f Reply) 

Removes and returns the element at the specified index in the array at path (https://redis.io/commands/json.arrpop).

The reply shape depends on the path syntax and popped value type, so this wrapper returns the raw Reply.

O(N) when the specified index is not the last element, otherwise O(1)

Since RedisJSON 1.0.0

jsonArrtrim Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the array.

-> Integer

Start index.

-> Integer

Stop index.

-> m (f Reply) 

Trims the array at path to contain only the specified inclusive range of indices from start to stop (https://redis.io/commands/json.arrtrim).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonClear Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Integer) 

Clears all values from an array or an object and sets numeric values at the root path to 0 (https://redis.io/commands/json.clear).

O(N) when path is evaluated to a single value where N is the size of the values, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 2.0.0

jsonClearAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to clear.

-> m (f Integer) 

Clears all values from an array or an object and sets numeric values at path to 0 (https://redis.io/commands/json.clear).

O(N) when path is evaluated to a single value where N is the size of the values, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 2.0.0

jsonDebug :: RedisCtx m f => m (f Reply) Source #

Executes the JSON debug container command (https://redis.io/commands/json.debug).

This is a container command for debugging related tasks.

N/A

Since RedisJSON 1.0.0

jsonDebugMemory Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Reply) 

Reports the size in bytes of a key at the root path (https://redis.io/commands/json.debug-memory).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonDebugMemoryAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to inspect.

-> m (f Reply) 

Reports the size in bytes of a key at path (https://redis.io/commands/json.debug-memory).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonDel Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Integer) 

Deletes a value at the root path (https://redis.io/commands/json.del).

O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonDelAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to delete.

-> m (f Integer) 

Deletes a value at path (https://redis.io/commands/json.del).

O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonForget Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Integer) 

Deletes a value at the root path (https://redis.io/commands/json.forget).

O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonForgetAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to delete.

-> m (f Integer) 

Deletes a value at path (https://redis.io/commands/json.forget).

O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonGet Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f (Maybe ByteString)) 

Gets the value at the root path in JSON serialized form (https://redis.io/commands/json.get).

O(N) when path is evaluated to a single value where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonGetOpts Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> JSONGetOpts

Formatting and path selection options.

-> m (f (Maybe ByteString)) 

Gets the value at one or more paths in JSON serialized form (https://redis.io/commands/json.get).

O(N) when path is evaluated to a single value where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonMerge Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to merge into.

-> ByteString

Serialized JSON value.

-> m (f Status) 

Merges a given JSON value into matching paths (https://redis.io/commands/json.merge).

Consequently, JSON values at matching paths are updated, deleted, or expanded with new children.

O(M+N) when path is evaluated to a single value where M is the size of the original value and N is the size of the new value, O(M+N) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value times the number of matches

Since RedisJSON 2.6.0

jsonMget Source #

Arguments

:: RedisCtx m f 
=> NonEmpty ByteString

Keys holding JSON values.

-> ByteString

Path to fetch from each key.

-> m (f [Maybe ByteString]) 

Returns the values at a path from one or more keys (https://redis.io/commands/json.mget).

O(M*N) when path is evaluated to a single value where M is the number of keys and N is the size of the value, O(N1+N2+dots+Nm) when path is evaluated to multiple values

Since RedisJSON 1.0.0

jsonMset Source #

Arguments

:: RedisCtx m f 
=> NonEmpty (ByteString, ByteString, ByteString)

Key, path, serialized JSON value triplets.

-> m (f Status) 

Sets or updates the JSON value of one or more keys (https://redis.io/commands/json.mset).

O(K*(M+N)) where K is the number of keys in the command

Since RedisJSON 2.6.0

jsonNumincrby Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the numeric value.

-> Double

Increment value.

-> m (f Reply) 

Increments the numeric value at path by a value (https://redis.io/commands/json.numincrby).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonNummultby Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the numeric value.

-> Double

Multiplier value.

-> m (f Reply) 

Multiplies the numeric value at path by a value (https://redis.io/commands/json.nummultby).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonObjkeys Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Reply) 

Returns the key names of JSON objects at the root path (https://redis.io/commands/json.objkeys).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value, where N is the number of keys in the object, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonObjkeysAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the object.

-> m (f Reply) 

Returns the key names of JSON objects at path (https://redis.io/commands/json.objkeys).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value, where N is the number of keys in the object, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonObjlen Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Reply) 

Returns the number of keys in JSON objects at the root path (https://redis.io/commands/json.objlen).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonObjlenAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the object.

-> m (f Reply) 

Returns the number of keys in JSON objects at path (https://redis.io/commands/json.objlen).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonResp Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Reply) 

Returns the JSON value at the root path in Redis Serialization Protocol (RESP) (https://redis.io/commands/json.resp).

The reply may be any RESP shape depending on the JSON value, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonRespAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to inspect.

-> m (f Reply) 

Returns the JSON value at path in Redis Serialization Protocol (RESP) (https://redis.io/commands/json.resp).

The reply may be any RESP shape depending on the JSON value, so this wrapper returns the raw Reply.

O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

when path is evaluated to a single value where $M$ is the size of the original value and $N$ is the size of the new value, $O(M+N)$ when path is evaluated to multiple values where $M$ is the size of the key and $N$ is the size of the new value times the number of matches

Since RedisJSON 1.0.0

jsonSet Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to set.

-> ByteString

Serialized JSON value.

-> m (f (Maybe Status)) 

jsonSetOpts Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to set.

-> ByteString

Serialized JSON value.

-> JSONSetOpts

Conditional and FPHA options.

-> m (f (Maybe Status)) 

Sets or updates the JSON value at a path (https://redis.io/commands/json.set).

O(M+N) when path is evaluated to a single value where M is the size of the original value and N is the size of the new value, O(M+N) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value times the number of matches

Since RedisJSON 1.0.0

jsonStrappend Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

String value to append.

-> m (f Reply) 

Appends a string to JSON strings at the root path (https://redis.io/commands/json.strappend).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonStrappendAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the JSON string.

-> ByteString

String value to append.

-> m (f Reply) 

Appends a string to JSON strings at path (https://redis.io/commands/json.strappend).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonToggle Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to the boolean value.

-> m (f Reply) 

Toggles a boolean value (https://redis.io/commands/json.toggle).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 2.0.0

jsonType Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> m (f Reply) 

Returns the type of the JSON value at the root path (https://redis.io/commands/json.type).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0

jsonTypeAt Source #

Arguments

:: RedisCtx m f 
=> ByteString

Key holding a JSON value.

-> ByteString

Path to inspect.

-> m (f Reply) 

Returns the type of the JSON value at path (https://redis.io/commands/json.type).

The reply shape depends on the path syntax, so this wrapper returns the raw Reply.

O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key

Since RedisJSON 1.0.0