Version limit

Stay organized with collections Save and categorize content based on your preferences.

Create a filter to limit the number of versions of columns to retrieve.

Explore further

For detailed documentation that includes this code sample, see the following:

Code sample

C++

To learn how to install and use the client library for Bigtable, see Bigtable client libraries.

cbt::Filter filter = cbt::Filter::ColumnRangeClosed("family", "c0", "c0");

C#

To learn how to install and use the client library for Bigtable, see Bigtable client libraries.

RowFilter filter = RowFilters.CellsPerRowLimit(1);

Node.js

To learn how to install and use the client library for Bigtable, see Bigtable client libraries.

const filter = [
  {
    column: {
      cellLimit: 1, // Only retrieve the most recent version of the cell.
    },
  },
];

Python

To learn how to install and use the client library for Bigtable, see Bigtable client libraries.

# Create a filter to only retrieve the most recent version of the cell
# for each column accross entire row.
row_filter = row_filters.CellsColumnLimitFilter(1)

Ruby

To learn how to install and use the client library for Bigtable, see Bigtable client libraries.

# Only retrieve the most recent version of the cell.
filter = Google::Cloud::Bigtable::RowFilter.cells_per_column 1

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.