Find data with filters

Filters are a foundational way to find data in any database. They are best for matching an exact value or range of values, such as finding a user by their user ID.

In Astra DB Serverless, you can use filters alone or with sorting.

Find data in the Astra Portal

In the Astra Portal, you can use the Data Explorer to apply simple metadata filters to collections in Serverless (Vector) databases.

For Serverless (Non-Vector) databases and tables in Serverless (Vector) databases, you can use the built-in cqlsh to execute CQL statements that use WHERE and ORDER BY clauses.

For required permissions, see Ways to find data in Astra DB Serverless.

  • Data Explorer

  • CQL Console

  1. In the Astra Portal, click the name of your Serverless (Vector) database.

    The Data Explorer isn’t available for Serverless (Non-Vector) databases. Instead, you can use the standalone cqlsh or drivers.

  2. Click Data Explorer.

  3. Select a Keyspace.

  4. Select a Collection or Table.

    The default search mode depends on the configuration of the collection or table:

    • With vector search: For vector-enabled collections and tables with vector columns, the default search is a vector search. To run a vector search, enter an embedding or text string in the Search field. To combine vector search with metadata filters, click Filters. Astra DB automatically adds an initial filter based on the identifier or primary key. For more information about vector search with or without metadata filters, see Find data with vector search

    • Without vector search: For a non-vector collections and tables without vector columns, Astra DB automatically adds an initial filter based on the identifier or primary key. You can use the default filter, modify it, or click Add Filter to add more filters.

  5. Edit the default filter or add a new filter, and then define the filter:

    1. Key: Select the field or column to filter on.

      When searching tables, the Data Explorer only allows you to query indexed columns to prevent queries with ALLOW FILTERING, which can be long-running and resource intensive.

    2. Condition: Select a filter condition, such as is or is not. Available filters depend on the data type of the Key. For more information about filter operators, see Filter operators for collections and Filter operators for tables.

    3. Value: Enter the filter value. Conditions like is, is not, and contains require an exact, case-sensitive match on the Value.

      Filter example: is

      For this example, assume that you have the following filter:

      • Key: character

      • Condition: is

      • Value: Lassie

      This filter returns all documents where the character field is exactly Lassie. It doesn’t return documents with values like lassie or Lassie Come Home, which are not exact, case-sensitive matches.

      Filter example: is not

      For this example, assume that you have the following filter:

      • Key: color

      • Condition: is not

      • Value: red

      This filter returns all documents where the color field isn’t exactly red. However, it can return documents containing Red and reddish, which are not exact, case-sensitive matches.

  6. To add more filters, click Add Filter.

    Additional filters are appended together with the and operator. For other operators, you must use the Data API.

    To remove a filter, click Delete.

  7. Click Apply.

    The Records section updates based on your filters. Click Table and JSON to view the results in table format or JSON format.

For information about the built-in cqlsh and executing CQL statements, see Cassandra Query Language (CQL) for Astra DB.

Find data with the Data API

If you’re new to the Data API, try the quickstart for collections or the quickstart for tables for a demo of some common operations.

With the Data API, you use filter and sort clauses to find data in collections and tables.

Any Data API command that involves finding data accepts one or both of these clauses.

  • Collections

  • Tables

For examples of filter and sort clauses in specific Data API commands, see the reference for the command that you want to run:

For general information about filter operators and sort clauses, see the following:

For examples of filter and sort clauses in specific Data API commands, see the reference for the command that you want to run:

For general information about filter operators and sort clauses, see the following:

Find data with CQL and drivers

Broadly speaking, you use the CQL WHERE and ORDER BY clauses to filter and sort data, and there are many ways to create complex CQL statements to find data efficiently.

For information about writing and executing CQL statements, see the following:

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax, an IBM Company | 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