Filter operators for tables

Use filter (query) operators to find rows in a table. You can use filter operators on all supported types except map, list, set, and vector.

For examples, see the references for commands that use these operators, such as Find a row, Find rows, and Find distinct values.

Operator type Name Purpose

Comparison query (Range)

$gt

Matches rows where the given column’s value is greater than the specified value.

$gte

Matches rows where the given column’s value is greater than or equal to the specified value.

$lt

Matches rows where the given column’s value is less than the specified value.

$lte

Matches rows where the given column’s value is less than or equal to the specified value.

Comparison query (Exact)

$eq

Matches rows where a given column’s value equals the specified value. This is the default when you do not specify an operator.

This is the only filter operator allowed in updateOne and deleteOne.

$ne

Matches rows where a given column’s value does not equal the specified value.

$in

Match one or more of an array of specified values. For example, "filter": { "COLUMN_NAME": { "$in": [ "VALUE", "VALUE" ] } }.

If you have only one value to match, an array is not necessary, such as { "$in": "VALUE" }.

$nin

Matches any of the values that are NOT IN a given array.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax | Privacy policy | Terms of use | Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com