Skip to content

Expressions in Aerospike

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

This tutorial describes how expressions work in Aerospike: how they are formed, their syntax, benefits, and how they are used in filters and operations.

This tutorial requires an Aerospike database running locally. See Setup to get started.

Introduction

In this tutorial, we will see how expressions work in Aerospike and benefits they provide.

The expressions functionality has been enhanced in Aerospike Database 5.6. Expressions appear in two flavors in the client library: Filter Expressions and Operation Expressions. Filter Expressions provide a mechanism to select records for operations. Operation Expressions enable new read and write capabilities as described later. Expressions are also used on server as XDR Filter Expressions to specify which records are shipped to remote destinations.

We will describe at a high level how expressions are formed in Aerospike and the capabilities they enable. After highlighting key syntax patterns, we will show with specific code examples how expressions are used.

The main topics in this tutorial include:

  • scope of expressions
  • benefits
  • syntax
  • usage
  • coding examples

Prerequisites

This tutorial assumes familiarity with the following topics:

In this tutorial

Setup

Verify your database is running, install the client, and initialize the connection.

Setup →

Filter expressions

Select records for queries and scans, with a full runnable example.

Filter expressions →

Operation expressions

Read and write computed values server-side, avoiding read-modify-write round trips.

Operation expressions →