K - Key type.V - Value type.@Experimental public class Filter<K,V> extends Object implements PostProcessingOperation<K,V>
Filters are applied after the query and relate to the current state of the pipeline. This allows filtering on computed fields created by APPLY operations or reducer results.
{
@code
// Filter by numeric comparison
Filter priceFilter = Filter.of("@price > 100");
// Filter by computed field
Filter totalFilter = Filter.of("@total_value > 1000");
}
PostProcessingOperation| Constructor and Description |
|---|
Filter(V expression)
Creates a new FILTER operation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
build(CommandArgs<K,V> args)
Build the operation arguments into the command args.
|
static <K,V> Filter<K,V> |
of(V expression)
Static factory method to create a Filter instance.
|
public Filter(V expression)
expression - the filter expression (e.g., "@price > 100", "@category == 'electronics'")public static <K,V> Filter<K,V> of(V expression)
K - Key typeV - Value typeexpression - the filter expressionpublic void build(CommandArgs<K,V> args)
PostProcessingOperationbuild in interface PostProcessingOperation<K,V>args - the command args to build intoCopyright © 2026 lettuce.io. All rights reserved.