OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Database

KV - V4.3.5
  • OBKV overview
  • Architecture
  • OBKV-Table
    • Introduction to OBKV-Table
      • Overview
      • OBKV-Table operation types
      • Core features of OBKV-Table
      • Differences between replace and insert_or_update
      • Supported value types
      • OBKV-Table data models
    • Use the OBKV-Table Java client
      • Java development guide for OBKV-Table
      • Prepare for development with OBKV-Table
      • Use the OBKV-Table Java client to connect to a cluster
      • Set client parameters
      • Supported client interfaces
      • Use the OBKV-Table Java client
    • Use the OBKV-Table GO client
      • Use the OBKV-Table Go client to connect to a cluster
      • Overview of the Go client
      • Individual API operations
      • Batch operations
      • About queries
      • Aggregation API
      • Filters
    • FAQ
  • OBKV-HBase
    • Overview
    • OBKV-HBase core features
    • Compatibility with HBase
    • Deployment
    • Application development with OBKV-HBase
      • Overview of OBKV-HBase application development
      • Data model
      • Data model design
      • Connect to a cluster using the OBKV-HBase client
      • Migrate HBase business code to OBKV-HBase
      • Data operation examples
      • Delete expired data
    • OBKV-HBase migration guide
    • OBKV-HBase management
      • Overview
      • High availability
      • Security and permissions
      • Monitoring metrics
    • Performance test
    • OBKV-HBase integrations
      • Flink
        • Synchronize data to OBKV-HBase by using Flink
    • Views
    • FAQ

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Database
  3. KV
  4. V4.3.5

Filters

Last Updated:2026-09-04 10:25:15

Filter types
ObTableFilterList
ObTableValueFilter
ObTableInFilter/ObTableNotInFilter
Example

Filter types

  • ObTableFilterList: connects different filters.
  • ObTableValueFilter: compares values.
  • ObTableInFilter/ObTableNotInFilter: checks whether the selected column value is equal to any of the values in the collection.

ObTableFilterList

This filter connects different filters by using And or Or.

The syntax is as follows:

const (
    OperatorAnd Operator = iota
    OperatorOr
)

You can use a function to obtain a filter list connected by And or Or. The syntax is as follows:

func AndList(filters ...ObTableFilter) *ObTableFilterList {
    return NewObTableFilterListWithOperatorAndTableFilter(OperatorAnd, filters...)
}

func OrList(filters ...ObTableFilter) *ObTableFilterList {
    return NewObTableFilterListWithOperatorAndTableFilter(OperatorOr, filters...)
}

ObTableValueFilter

This filter is the most basic filter used to check whether the values of a column meet the specified conditions. The columns that meet the specified conditions are chosen.

The syntax is as follows:

const (
    LessThan ObCompareOperator = iota
    GreaterThan
    LessOrEqualThan
    GreaterOrEqualThan
    NotEqual
    Equal
    IsNull
    IsNotNull
)

func CompareVal(op ObCompareOperator, columnName string, value interface{}) *ObTableValueFilter {
    return NewObTableValueFilter(op, columnName, value)
}

Input parameters:

  • op: defines the method for comparison between column names and values, which is contained in the value of const.
  • columnName: the column name for comparison.
  • value: the value to be compared with the column name.

ObTableInFilter/ObTableNotInFilter

The syntax is as follows:

func In(columnName string, values ...interface{}) *ObTableInFilter {
    return NewObTableInFilter(columnName, values...)
}

func NotIn(columnName string, values ...interface{}) *ObTableNotInFilter {
    return NewObTableNotInFilter(columnName, values...)
}

Input parameters:

  • columnName: the column name for comparison.
  • values: the values to be compared with the column name. ObTableInFilter checks whether the column name is equal to any of the values. ObTableNotInFilter checks whether the column name is not equal to any of the values. The values of the column are not included in values.

Example

// 4 < c1 < 6
c1lt6 := filter.CompareVal(filter.LessThan, "c1", int64(6))
c1gt4 := filter.CompareVal(filter.GreaterThan, "c1", int64(4))
c1filterList := filter.AndList(c1lt6, c1gt4)

// 0 >= c2 or c2 >= 2
c2le0 := filter.CompareVal(filter.LessOrEqualThan, "c2", int64(0))
c2ge2 := filter.CompareVal(filter.GreaterOrEqualThan, "c2", int64(2))
c2filterList := filter.orList(c2le0, c2ge2)

// (4 < c1 < 6 ) && (c2 <= 0) && (c2 >= 2)
finalFilter := filter.AndList(c1filterList, c2filterList)

Previous topic

Aggregation API
Last

Next topic

FAQ
Next
on this page
Filter types
ObTableFilterList
ObTableValueFilter
ObTableInFilter/ObTableNotInFilter
Example