SingleColumnValueFilter specifies a single filter condition, for example, column_a>5. It is applicable to ConditionUpdate (conditional update) and Filter features.

Data structure

message SingleColumnValueFilter {
    required ComparatorType comparator = 1;
    required string column_name = 2;
    required bytes column_value = 3;
    required bool filter_if_missing = 4;
    required bool latest_version_only = 5; 
    optional ValueTransferRule value_transfer_rule =6;
     
}                
Parameter Type Required Description
comparator ComparatorType Yes The relational operator.
column_name string Yes The name of the column.
column_value bytes Yes The column value after PlainBuffer encoding.
filter_if_missing bool Yes Specifies whether the filter condition is applicable when the specified column in a row does not exist. Valid values:
  • true: The row is kept. This is the default value.
  • false: The row is filtered out.

For example, if the filter condition is column_a>0 and filter_if_missing is set to true, when column_a does not exist in a row, the row is kept.

latest_version_only bool Yes Specifies whether the filter condition applies only to the latest version. Valid values:
  • true: returns a row only when the latest version of the column value matches the condition. This is the default value.
  • false: returns a row when any version of the column value matches the condition.
value_transfer_rule ValueTransferRule No Converts the data type of a value that is obtained by matching a regular expression to String, Integer, or Double.

If you store column data in a custom format such as JSON string and want to filter and query the column data by using a subfield value, you must set this parameter.

Related operations