Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions content/commands/bf.add.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ If `key` does not exist - a new Bloom filter is created with default error rate,
is an item to add.
</details>

## Return value

Returns one of these replies:

- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - where "1" means that the item has been added successfully, and "0" means that such item was already added to the filter (which could be wrong)
- [] on error (invalid arguments, wrong key type, etc.) and also when the filter is full

## Examples

{{< highlight bash >}}
Expand All @@ -64,3 +57,21 @@ redis> BF.ADD bf item1
redis> BF.ADD bf item1
(integer) 0
{{< / highlight >}}

## Return information

{{< multitabs id="bf-add-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Integer reply](../../develop/reference/protocol-spec#integers): `1` for successfully adding an item, or `0` if there's a probability that the item was already added to the filter.
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, wrong key type, or when the filter is full.

-tab-sep-

One of the following:
* [Boolean reply](../../develop/reference/protocol-spec#booleans): `true` for successfully adding an item, or `false` if there's a probability that the item was already added to the filter.
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, wrong key type, or when the filter is full.

{{< /multitabs >}}
30 changes: 21 additions & 9 deletions content/commands/bf.card.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ is key name for a Bloom filter.

</details>

## Return value

Returns one of these replies:

- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the number of items that were added to this Bloom filter and detected as unique (items that caused at least one bit to be set in at least one sub-filter), or 0 when `key` does not exist.
- [] on error (invalid arguments, wrong key type, etc.)

Note: when `key` exists - return the same value as `BF.INFO key ITEMS`.

## Examples

{{< highlight bash >}}
Expand All @@ -60,3 +51,24 @@ redis> BF.CARD bf1
redis> BF.CARD bf_new
(integer) 0
{{< / highlight >}}

## Return information

{{< multitabs id="bf-card-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the number of items detected as unique that were added to the Bloom filter (items that caused at least one bit to be set in at least one sub-filter), or `0` when the given `key` does not exist.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, or when the filter is full.

Note: when `key` exists, `BF.CARD` returns the same value as `BF.INFO key ITEMS`.

-tab-sep-

One of the following:
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the number of items detected as unique that were added to the Bloom filter (items that caused at least one bit to be set in at least one sub-filter), or `0` when the given `key` does not exist.
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, wrong key type, or when the filter is full.

Note: when `key` exists, `BF.CARD` returns the same value as `BF.INFO key ITEMS`.
{{< /multitabs >}}
25 changes: 18 additions & 7 deletions content/commands/bf.exists.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ is key name for a Bloom filter.
is an item to check.
</details>

## Return value

Returns one of these replies:

- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}), where `1` means that, with high probability, `item` was already added to the filter, and `0` means that `key` does not exist or that `item` had not been added to the filter.
- [] on error (invalid arguments, wrong key type, etc.)

## Examples

{{< highlight bash >}}
Expand All @@ -65,3 +58,21 @@ redis> BF.EXISTS bf item1
redis> BF.EXISTS bf item2
(integer) 0
{{< / highlight >}}

## Return information

{{< multitabs id="bf-exists-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): `1` means that, with high probability, `item` was already added to the filter, and `0` means that either the `key` does not exist or that the `item` had not been added to the filter.
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) if invalid arguments are passed.

-tab-sep-

One of the following:
* [Boolean reply]({{< relref "/develop/reference/protocol-spec#booleans" >}}): `true` means that, with high probability, `item` was already added to the filter, and `false` means that either `key` does not exist or that `item` had not been added to the filter.
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) if invalid arguments are passed or `key` is not of the correct type.

{{< /multitabs >}}
32 changes: 18 additions & 14 deletions content/commands/bf.info.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,6 @@ Return the number of items that were added to this Bloom filter and detected as
Return the expansion rate.
</details>

When no optional argument is specified: return all information fields.

## Return value

When no optional argument is specified, returns one of these replies:

- [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with argument name ([Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}})) and value ([Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}})) pairs
- [] on error (invalid arguments, key does not exist, wrong key type, and so on)

When an optional argument is specified, returns one of these replies:

- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - argument value
- [] on error (invalid arguments, key does not exist, wrong key type, and so on)

## Examples

{{< highlight bash >}}
Expand All @@ -117,3 +103,21 @@ redis> BF.INFO bf1
redis> BF.INFO bf1 CAPACITY
1) (integer) 100
{{< / highlight >}}

## Return information

{{< multitabs id="bf-info-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with argument name ([Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}})) and value ([Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}})) pairs.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, or when the key does not exist.

-tab-sep-

One of the following:
* [Map reply]({{< relref "/develop/reference/protocol-spec#maps" >}}) with argument name ([Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}})) and value ([Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}})) pairs.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, or when the key does not exist.

{{< /multitabs >}}
31 changes: 22 additions & 9 deletions content/commands/bf.insert.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@ If the number of elements to be stored in the filter is unknown, use an `expansi
Otherwise, use an `expansion` of `1` to reduce memory consumption. The default value is `2`.
</details>

## Return value

Returns one of these replies:

- [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) where each element is one of these options:
- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}), where `1` denotes that the item has been added successfully, and `0` means that such item had already added to the filter (which could be wrong)
- [] when the item cannot be added because the filter is full
- [], for example, when the number of arguments or key type is wrong, and also when `NOCREATE` is specified and `key` does not exist.

## Examples

Add three items to a filter, then create the filter with default parameters if it does not already exist.
Expand All @@ -146,3 +137,25 @@ Add two items to a filter, then return error if the filter does not already exis
{{< highlight bash >}}
BF.INSERT filter NOCREATE ITEMS foo bar
{{< / highlight >}}

## Return information

{{< multitabs id="bf-insert-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following: where each element is one of these options:
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}), where each element is one of the following options:
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) `1` for successfully adding an item, or `0` if there's a probability that the item was already added to the filter.
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings">}}) when the item cannot be added because the filter is full.
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings">}}) when the number of arguments or key type is wrong, and also when `NOCREATE` is specified and `key` does not exist.

-tab-sep-

One of the following: where each element is one of these options:
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}), where each element is one of the following options:
* [Boolean reply]({{< relref "/develop/reference/protocol-spec#booleans" >}}) `true` for successfully adding an item, or `false` if there's a probability that the item was already added to the filter.
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings">}}) when the item cannot be added because the filter is full.
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings">}}) when the number of arguments or key type is wrong, and also when `NOCREATE` is specified and `key` does not exist.

{{< /multitabs >}}
23 changes: 17 additions & 6 deletions content/commands/bf.loadchunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,24 @@ Iterator value associated with `data` (returned by [`BF.SCANDUMP`]({{< relref "c
Current data chunk (returned by [`BF.SCANDUMP`]({{< relref "commands/bf.scandump/" >}}))
</details>

## Return value
## Examples

Returns one of these replies:
See [`BF.SCANDUMP`]({{< relref "commands/bf.scandump/" >}}) for an example.

- [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if executed correctly
- [] on error (invalid arguments, wrong key type, wrong data, etc.)
## Return information

## Examples
{{< multitabs id="bf-loadchunk-return-info"
tab1="RESP2"
tab2="RESP3" >}}

See [`BF.SCANDUMP`]({{< relref "commands/bf.scandump/" >}}) for an example.
One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
* [Simple error]({{< relref "/develop/reference/protocol-spec#simple-errors">}}) in these cases: invalid arguments, wrong key type, or when invalid data was passed.

-tab-sep-

One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
* [Simple error]({{< relref "/develop/reference/protocol-spec#simple-errors">}}) in these cases: invalid arguments, wrong key type, or when invalid data was passed.

{{< /multitabs >}}
24 changes: 23 additions & 1 deletion content/commands/bf.madd.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ If `key` does not exist - a new Bloom filter is created with default error rate,
One or more items to add.
</details>

## Return value
## Return information

Returns one of these replies:

Expand All @@ -72,3 +72,25 @@ redis> BF.MADD bf item1 item2 item2
2) (integer) 1
3) (integer) 0
{{< / highlight >}}

## Return information

{{< multitabs id="bf-madd-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) where each element is either
* an [integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}), where `1` means that the item has been added successfully, and `0` means there's a probability that the item was already added to the filter.
* a [simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) when the item cannot be added because the filter is full.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, key not found, wrong key type, or when the filter is full.

-tab-sep-

One of the following:
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) where each element is either
* a [boolean reply]({{< relref "/develop/reference/protocol-spec#booleans" >}}), where `true` means that the item has been added successfully, and `false` means there's a probability that the item was already added to the filter.
* a [simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) when the item cannot be added because the filter is full.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, key not found, wrong key type, or when the filter is full.

{{< /multitabs >}}
25 changes: 18 additions & 7 deletions content/commands/bf.mexists.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ is key name for a Bloom filter.
One or more items to check.
</details>

## Return value

Returns one of these replies:

- [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - where "1" means that, with high probability, `item` was already added to the filter, and "0" means that `key` does not exist or that `item` was definitely not added to the filter.
- [] on error (invalid arguments, wrong key type, etc.)

## Examples

{{< highlight bash >}}
Expand All @@ -68,3 +61,21 @@ redis> BF.MEXISTS bf item1 item2 item3
2) (integer) 1
3) (integer) 0
{{< / highlight >}}

## Return information

{{< multitabs id="bf-mexists-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [integer replies]({{< relref "/develop/reference/protocol-spec#integers" >}}), where `1` means that, with high probability, `item` was already added to the filter, and `0` means that `key` does not exist or that `item` was definitely not added to the filter.
* [Simple error] in these cases: in these cases: invalid arguments, wrong key type, or when the key was not found.

-tab-sep-

One of the following:
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [boolean replies]({{< relref "/develop/reference/protocol-spec#booleans" >}}), where `true` means that, with high probability, `item` was already added to the filter, and `false` means that `key` does not exist or that `item` was definitely not added to the filter.
* [Simple error]: in these cases: in these cases: invalid arguments, wrong key type, or when the key was not found.

{{< /multitabs >}}
25 changes: 18 additions & 7 deletions content/commands/bf.reserve.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ If the number of items to be stored in the filter is unknown, you use an `expans
Otherwise, you use an `expansion` of `1` to reduce memory consumption. The default value is `2`.
</details>

## Return value

Returns one of these replies:

- [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if filter created successfully
- [] on error (invalid arguments, key already exists, etc.)

## Examples

{{< highlight bash >}}
Expand All @@ -123,3 +116,21 @@ OK
redis> BF.RESERVE bf_non 0.01 1000 NONSCALING
OK
{{< / highlight >}}

## Return information

{{< multitabs id="bf-reserve-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK` if the filter was created successfully.
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments or the key already exists.

-tab-sep-

One of the following:
* [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK` if the filter was created successfully.
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments or the key already exists.

{{< /multitabs >}}
36 changes: 26 additions & 10 deletions content/commands/bf.scandump.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,7 @@ is key name for a Bloom filter to save.
Iterator value; either 0 or the iterator from a previous invocation of this command
</details>

## Return value

Returns one of these replies:

- [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) (_Iterator_) and [] (_Data_).

The Iterator is passed as input to the next invocation of `BF.SCANDUMP`. If _Iterator_ is 0, then it means iteration has completed.

The iterator-data pair should also be passed to [`BF.LOADCHUNK`]({{< relref "commands/bf.loadchunk/" >}}) when restoring the filter.

- [] on error (invalid arguments, key not found, wrong key type, etc.)

## Examples

Expand Down Expand Up @@ -105,3 +95,29 @@ for chunk in chunks:
iter, data = chunk
BF.LOADCHUNK(key, iter, data)
{{< / highlight >}}

## Return information

{{< multitabs id="bf-scandump-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Array reply](../../develop/reference/protocol-spec#arrays): a two-element array of an [Integer reply]({{< relref "/develop/reference/protocol-spec#integers">}}) (_Iterator_) and a [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings) (_Data_).
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, the key was not found, or the key is of the wrong type.

The Iterator is passed as input to the next invocation of `BF.SCANDUMP`. If _Iterator_ is 0, then it means iteration has completed.

The iterator-data pair should also be passed to [`BF.LOADCHUNK`]({{< relref "commands/bf.loadchunk/" >}}) when restoring the filter.

-tab-sep-

One of the following:
* [Array reply](../../develop/reference/protocol-spec#arrays): a two-element array of an [Integer reply]({{< relref "/develop/reference/protocol-spec#integers">}}) (_Iterator_) and a [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings) (_Data_).
* [Simple error reply](../../develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, the key was not found, or the key is of the wrong type.

The Iterator is passed as input to the next invocation of `BF.SCANDUMP`. If _Iterator_ is 0, then it means iteration has completed.

The iterator-data pair should also be passed to [`BF.LOADCHUNK`]({{< relref "commands/bf.loadchunk/" >}}) when restoring the filter.

{{< /multitabs >}}