All Products
Search
Document Center

Tablestore:SingleColumnValueFilter

Last Updated:Aug 28, 2024

Specifies a single filter condition, such as column_a>5. SingleColumnValueFilter is used for the 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 meets the condition. This is the default value.

  • false: returns a row when any version of the column value meets the condition.

value_transfer_rule

ValueTransferRule

No

Converts a string to the String, Integer, or Double type after the string is matched by using a regular expression.

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 configure this parameter.

References