---
title: "Comparison"
description: "Aerospike comparison expression operators guide: eq, ne, lt, gt, cmp_regex, cmp_geo, and in_list membership tests."
---

# Comparison

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

Comparison expressions evaluate to a boolean (`true` or `false`). You use them anywhere filter expressions are allowed—for example record filters on single-key, batch, scan, and query operations; `FilterExpression` on query and batch policies; [XDR filters](https://aerospike.com/docs/database/manage/xdr/filters/); and operation expressions (read/write expression ops) where the API expects a boolean.

Both operands must be the **same type** — two integers, or two strings, but never an integer and a float. A mismatch fails the command with error 4 (parameter error), rather than evaluating to `false`. A bin that holds a different type from the one its reader expects is another matter: the reader evaluates to `unknown`, so as a filter the record is rejected like any other non-match. GeoJSON and HLL cannot be compared at all; use [`cmp_geo`](#cmp_geo) for GeoJSON. See [Types](https://aerospike.com/docs/develop/expressions/#types) on the expressions overview.

Together with [logical](https://aerospike.com/docs/develop/expressions/logic) operators, comparisons drive most record selection. When a comparison (or its inputs) cannot be resolved in the metadata-only phase, the result may be `unknown` until storage is read; see the [execution model](https://aerospike.com/docs/develop/expressions/#execution-model) on the expressions overview.

This reference covers the wire-level operators `eq`, `ne`, `lt`, `gt`, `le`, `ge`, `cmp_regex`, `cmp_geo`, and the `in_list` membership test (Database 8.1.2 and later). The examples use bins and thresholds aligned with the [bookstore scenario](https://aerospike.com/docs/develop/expressions/path#bookstore-example) on the path expressions page.

The Developer SDK’s [AEL](https://aerospike.com/docs/develop/client/sdk/concepts/ael/reference) text syntax expresses the same comparisons inline, for example `$.age >= 21`.

Each operation’s Example shows the code in nine tabs: Aerospike Expression Language (AEL) text on the Java SDK and Python SDK tabs, and the `Exp` builder on the other seven. See the [AEL reference](https://aerospike.com/docs/develop/client/sdk/concepts/ael/reference) for AEL grammar.

## String values

`eq`, `ne`, `gt`, `ge`, `lt`, and `le` compare String values by UTF-8 bytes. The six String search operations in Database 8.2.0 treat canonically equivalent spellings as equal, so their results can differ from comparison operators. See [Compare String values](https://aerospike.com/docs/develop/data-types/string/comparison).

## Map values

As of Database 8.2.0, `eq`, `ne`, `gt`, `ge`, `lt`, and `le` compare Maps by content, regardless of subtype. Two Maps with the same elements are equal whether they are Unordered, K-ordered, or KV-ordered, including Maps nested in a List or another Map. See [Ordering](https://aerospike.com/docs/develop/data-types/collections/ordering#map) for how one Map orders against another.

Before Database 8.2.0, a comparison evaluates to [`unknown`](https://aerospike.com/docs/develop/expressions/#unknown-results) when either operand is an Unordered Map or contains one, so a record filter built on it matches no records.

## Ops

#### `cmp_geo`

```python
cmp_geo(left, right)
```

Description: Returns `true` if the **left** is either contained within or contains the **right**.

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `left` | `geojson` | 
GeoJSON point or region. Any expression that evaluates to a GeoJSON value.

 |
| `right` | `geojson` | 

The GeoJSON value to test `left` against. One operand must be a point and the other a region; two points, or two regions, always return `false`.

 |

Returns: `boolean`

Introduced: 5.2.0.4

Example: Find records where GeoJSON bin `region` contains the given point (San Francisco Bay area). The point is standard GeoJSON; escape quotes as needed in your language.

-   [Java SDK](#tab-panel-1275)
-   [Python SDK](#tab-panel-1276)
-   [Rust](#tab-panel-1277)
-   [C#](#tab-panel-1278)
-   [Go](#tab-panel-1279)
-   [Node.js](#tab-panel-1280)
-   [C](#tab-panel-1281)
-   [Java](#tab-panel-1282)
-   [Python](#tab-panel-1283)

```java
String exp = "geoCompare("

    + "geoJson('{\"type\":\"Point\",\"coordinates\":[-122.4,37.8]}'), $.region)";
```

```python
exp = ("geoCompare("

       "geoJson('{\"type\":\"Point\",\"coordinates\":[-122.4,37.8]}'), $.region)")
```

```rust
use aerospike::expressions::{geo_bin, geo_compare, geo_val};

let point = "{\"type\":\"Point\",\"coordinates\":[-122.4,37.8]}";

let exp = geo_compare(geo_val(point.into()), geo_bin("region".into()));
```

```csharp
string point = "{\"type\":\"Point\",\"coordinates\":[-122.4,37.8]}";

Expression exp = Exp.Build(

  Exp.GeoCompare(Exp.Geo(point), Exp.GeoBin("region")));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

point := "{\"type\":\"Point\",\"coordinates\":[-122.4,37.8]}"

exp := as.ExpGeoCompare(as.ExpGeoVal(point), as.ExpGeoBin("region"))
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.cmpGeo(

  exp.geo(new Aerospike.GeoJSON({ type: 'Point', coordinates: [-122.4, 37.8] })),

  exp.binGeo('region'))
```

```c
as_exp_build(predexp,

  as_exp_cmp_geo(

    as_exp_geo("{\"type\":\"Point\",\"coordinates\":[-122.4,37.8]}"),

    as_exp_bin_geo("region")));
```

```java
String point = "{\"type\":\"Point\",\"coordinates\":[-122.4,37.8]}";

Expression exp = Exp.build(

  Exp.geoCompare(Exp.geo(point), Exp.geoBin("region")));
```

```python
import aerospike

from aerospike_helpers.expressions import CmpGeo, GeoBin

point = aerospike.GeoJSON(

    '{"type":"Point","coordinates":[-122.4,37.8]}')

exp = CmpGeo(point, GeoBin("region")).compile()
```

---

#### `cmp_regex`

`deprecated`

```python
cmp_regex(options_value, regex_string, string)
```

Description: Returns `true` if the regex\_string matches the **string**, otherwise returns `false`. Uses POSIX regex and is not Unicode-compatible. Superseded by [string\_regex\_compare](https://aerospike.com/develop/expressions/string#string_regex_compare).

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `options_value` | `integer literal` | 
POSIX `regcomp` flags, combined with bitwise OR, or `0` for none: `1` extended syntax, `2` case-insensitive, `4` newline-sensitive matching, `8` no effect. Pass the numbers — most clients name `4` `NOSUB` and `8` `NEWLINE`, the reverse of what the server applies.

 |
| `regex_string` | `string literal` | 

POSIX regular expression to match. Compiled once when the expression is built, so it cannot be computed from a bin.

 |
| `string` | `string` | 

String bin to match against, or any expression that evaluates to a string.

 |

Returns: `boolean`

Introduced: 5.2.0.4

Example: Find records where string bin `phone_num` starts with area code `555`.

-   [Rust](#tab-panel-1284)
-   [C#](#tab-panel-1285)
-   [Go](#tab-panel-1286)
-   [Node.js](#tab-panel-1287)
-   [C](#tab-panel-1288)
-   [Java](#tab-panel-1289)
-   [Python](#tab-panel-1290)

```rust
use aerospike::expressions::{regex_compare, string_bin};

use aerospike::RegexFlag;

let exp = regex_compare(

    "^555.*".into(),

    RegexFlag::NONE as i64,

    string_bin("phone_num".into()));
```

```csharp
Expression exp = Exp.Build(

  Exp.RegexCompare("^555.*", RegexFlag.NONE, Exp.StringBin("phone_num")));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

exp := as.ExpRegexCompare("^555.*", as.ExpRegexFlagNONE, as.ExpStringBin("phone_num"))
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.cmpRegex(0, '^555.*', exp.binStr('phone_num'))
```

```c
as_exp_build(predexp,

  as_exp_cmp_regex(0, "^555.*", as_exp_bin_str("phone_num")));
```

```java
// import com.aerospike.client.query.RegexFlag;

Expression exp = Exp.build(

  Exp.regexCompare("^555.*", RegexFlag.NONE, Exp.stringBin("phone_num")));
```

```python
from aerospike_helpers.expressions import CmpRegex, StrBin

exp = CmpRegex(0, "^555.*", StrBin("phone_num")).compile()
```

---

#### `eq`

```python
eq(left, right)
```

Description: Returns `true` if the **left** is equal to the **right**, otherwise returns `false`. **left** and **right** must result in the same fundamental type.

When both operands are strings, `eq` tests UTF-8 byte equality. A precomposed `é` (U+00E9) and an `e` followed by a combining acute accent (U+0301) are not equal. The string search operations treat those spellings as the same text. See [Compare String values](https://aerospike.com/develop/data-types/string/comparison).

As of Database 8.2.0, `eq` compares Maps by content regardless of subtype. Two Maps with the same elements are equal whether they are Unordered, K-ordered, or KV-ordered, including Maps nested in a List or another Map. Before Database 8.2.0, `eq` returns `unknown` when either operand is an Unordered Map or contains one. See [Map values](https://aerospike.com/develop/expressions/comparison#map-values).

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `left` | `any` | 
Left operand. Any expression that evaluates to an integer, float, string, blob, boolean, list, or map. GeoJSON and HLL cannot be compared this way; for GeoJSON use [`cmp_geo`](#cmp_geo).

 |
| `right` | `any` | 

Right operand. Must evaluate to the same type as `left`.

 |

Returns: `boolean`

Introduced: 5.2.0.4

Example: Find records where string bin `category` equals `fiction`, matching the [bookstore example](https://aerospike.com/docs/develop/expressions/path#bookstore-example) on the path expressions overview.

-   [Java SDK](#tab-panel-1291)
-   [Python SDK](#tab-panel-1292)
-   [Rust](#tab-panel-1293)
-   [C#](#tab-panel-1294)
-   [Go](#tab-panel-1295)
-   [Node.js](#tab-panel-1296)
-   [C](#tab-panel-1297)
-   [Java](#tab-panel-1298)
-   [Python](#tab-panel-1299)

```java
String exp = "$.category == 'fiction'";
```

```python
exp = "$.category == 'fiction'"
```

```rust
use aerospike::expressions::{eq, string_bin, string_val};

let exp = eq(string_bin("category".into()), string_val("fiction".into()));
```

```csharp
Expression exp = Exp.Build(

  Exp.EQ(Exp.StringBin("category"), Exp.Val("fiction")));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

exp := as.ExpEq(as.ExpStringBin("category"), as.ExpStringVal("fiction"))
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.eq(exp.binStr('category'), exp.str('fiction'))
```

```c
as_exp_build(predexp,

  as_exp_cmp_eq(as_exp_bin_str("category"), as_exp_str("fiction")));
```

```java
Expression exp = Exp.build(

  Exp.eq(Exp.stringBin("category"), Exp.val("fiction")));
```

```python
from aerospike_helpers.expressions import Eq, StrBin

exp = Eq(StrBin("category"), "fiction").compile()
```

---

#### `ge`

```python
ge(left, right)
```

Description: Returns `true` if the **left** is greater than or equal to the **right**, otherwise returns `false`. **left** and **right** must result in the same fundamental type.

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `left` | `any` | 
Left operand. Any expression that evaluates to an integer, float, string, blob, boolean, list, or map. GeoJSON and HLL cannot be compared this way; for GeoJSON use [`cmp_geo`](#cmp_geo).

 |
| `right` | `any` | 

Right operand. Must evaluate to the same type as `left`.

 |

Returns: `boolean`

Introduced: 5.2.0.4

Example: Find records where integer bin `quantity` is at least 1 (in-stock style), aligned with variant `quantity` fields in the [path quickstart](https://aerospike.com/docs/develop/expressions/path/quickstart) inventory example.

-   [Java SDK](#tab-panel-1300)
-   [Python SDK](#tab-panel-1301)
-   [Rust](#tab-panel-1302)
-   [C#](#tab-panel-1303)
-   [Go](#tab-panel-1304)
-   [Node.js](#tab-panel-1305)
-   [C](#tab-panel-1306)
-   [Java](#tab-panel-1307)
-   [Python](#tab-panel-1308)

```java
String exp = "$.quantity >= 1";
```

```python
exp = "$.quantity >= 1"
```

```rust
use aerospike::expressions::{ge, int_bin, int_val};

let exp = ge(int_bin("quantity".into()), int_val(1));
```

```csharp
Expression exp = Exp.Build(

  Exp.GE(Exp.IntBin("quantity"), Exp.Val(1)));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

exp := as.ExpGreaterEq(as.ExpIntBin("quantity"), as.ExpIntVal(1))
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.ge(exp.binInt('quantity'), exp.int(1))
```

```c
as_exp_build(predexp,

  as_exp_cmp_ge(as_exp_bin_int("quantity"), as_exp_int(1)));
```

```java
Expression exp = Exp.build(

  Exp.ge(Exp.intBin("quantity"), Exp.val(1)));
```

```python
from aerospike_helpers.expressions import GE, IntBin

exp = GE(IntBin("quantity"), 1).compile()
```

---

#### `gt`

```python
gt(left, right)
```

Description: Returns `true` if the **left** is greater than the **right**, otherwise returns `false`. **left** and **right** must result in the same fundamental type.

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `left` | `any` | 
Left operand. Any expression that evaluates to an integer, float, string, blob, boolean, list, or map. GeoJSON and HLL cannot be compared this way; for GeoJSON use [`cmp_geo`](#cmp_geo).

 |
| `right` | `any` | 

Right operand. Must evaluate to the same type as `left`.

 |

Returns: `boolean`

Introduced: 5.2.0.4

Example: Find records where the time-to-live (TTL) is greater than one year (365 days in seconds).

-   [Java SDK](#tab-panel-1309)
-   [Python SDK](#tab-panel-1310)
-   [Rust](#tab-panel-1311)
-   [C#](#tab-panel-1312)
-   [Go](#tab-panel-1313)
-   [Node.js](#tab-panel-1314)
-   [C](#tab-panel-1315)
-   [Java](#tab-panel-1316)
-   [Python](#tab-panel-1317)

```java
String exp = "$.ttl() > 365 * 24 * 3600";
```

```python
exp = "$.ttl() > 365 * 24 * 3600"
```

```rust
use aerospike::expressions::{gt, int_val, ttl};

let exp = gt(ttl(), int_val(365 * 24 * 3600));
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(Exp.TTL(), Exp.Val(365 * 24 * 3600)));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

exp := as.ExpGreater(as.ExpTTL(), as.ExpIntVal(365*24*3600))
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(exp.ttl(), exp.int(365 * 24 * 3600))
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(as_exp_ttl(), as_exp_int(365 * 24 * 3600)));
```

```java
Expression exp = Exp.build(

  Exp.gt(Exp.ttl(), Exp.val(365 * 24 * 3600)));
```

```python
from aerospike_helpers.expressions import GT, TTL

exp = GT(TTL(), 365 * 24 * 3600).compile()
```

---

#### `in_list`

```python
in_list(value, list)
```

Description: Returns `true` if **value** is contained in **list**, otherwise returns `false`.

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `value` | `any` | 
Value to look for. Matching is by type as well as by value, so an integer never matches a float and a boolean never matches an integer.

 |
| `list` | `list` | 

List to search. A list bin, a list literal, or any expression that evaluates to a list; its elements need not all be of one type.

 |

Returns: `boolean`

Introduced: 8.1.2

Example: Filter records where string bin `color` is one of `“red”`, `“blue”`, or `“green”`.

-   [Java SDK](#tab-panel-1318)
-   [Python SDK](#tab-panel-1319)
-   [Rust](#tab-panel-1320)
-   [C#](#tab-panel-1321)
-   [Go](#tab-panel-1322)
-   [Node.js](#tab-panel-1323)
-   [C](#tab-panel-1324)
-   [Java](#tab-panel-1325)
-   [Python](#tab-panel-1326)

```java
String exp = "$.color in ['red', 'blue', 'green']";
```

```python
exp = "$.color in ['red', 'blue', 'green']"
```

```rust
use aerospike::expressions::{in_list, list_val, string_bin};

use aerospike::Value;

let exp = in_list(

    string_bin("color".into()),

    list_val(vec![Value::from("red"), Value::from("blue"), Value::from("green")]));
```

```csharp
using System.Collections.Generic;

Expression exp = Exp.Build(

  Exp.InList(

    Exp.StringBin("color"),

    Exp.Val(new List<string> { "red", "blue", "green" })));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

exp := as.ExpInList(

  as.ExpStringBin("color"),

  as.ExpListVal(

    as.NewValue("red"),

    as.NewValue("blue"),

    as.NewValue("green"),

  ),

)
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.inList(

  exp.binStr('color'),

  exp.list(['red', 'blue', 'green']))
```

```c
as_arraylist colors;

as_arraylist_init(&colors, 3, 0);

as_arraylist_append_str(&colors, "red");

as_arraylist_append_str(&colors, "blue");

as_arraylist_append_str(&colors, "green");

as_exp_build(predexp,

  as_exp_in_list(

    as_exp_bin_str("color"),

    as_exp_val(&colors)));

as_arraylist_destroy(&colors);
```

```java
import com.aerospike.client.exp.Expression;

import com.aerospike.client.exp.Exp;

import java.util.List;

Expression exp = Exp.build(

  Exp.inList(

    Exp.stringBin("color"),

    Exp.val(List.of("red", "blue", "green"))));
```

```python
from aerospike_helpers.expressions import StrBin, Val

from aerospike_helpers.expressions.list import InList

# The list operand must be an expression: a bare Python list is read as

# a bin name and fails when the operation is sent.

exp = InList(StrBin("color"), Val(["red", "blue", "green"])).compile()
```

---

#### `le`

```python
le(left, right)
```

Description: Returns `true` if the **left** is less than or equal to the **right**, otherwise returns `false`. **left** and **right** must result in the same fundamental type.

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `left` | `any` | 
Left operand. Any expression that evaluates to an integer, float, string, blob, boolean, list, or map. GeoJSON and HLL cannot be compared this way; for GeoJSON use [`cmp_geo`](#cmp_geo).

 |
| `right` | `any` | 

Right operand. Must evaluate to the same type as `left`.

 |

Returns: `boolean`

Introduced: 5.2.0.4

Example: Find records where integer bin `quantity` is at most 100 (cap on on-hand units), consistent with inventory-style bins in the path documentation.

-   [Java SDK](#tab-panel-1327)
-   [Python SDK](#tab-panel-1328)
-   [Rust](#tab-panel-1329)
-   [C#](#tab-panel-1330)
-   [Go](#tab-panel-1331)
-   [Node.js](#tab-panel-1332)
-   [C](#tab-panel-1333)
-   [Java](#tab-panel-1334)
-   [Python](#tab-panel-1335)

```java
String exp = "$.quantity <= 100";
```

```python
exp = "$.quantity <= 100"
```

```rust
use aerospike::expressions::{int_bin, int_val, le};

let exp = le(int_bin("quantity".into()), int_val(100));
```

```csharp
Expression exp = Exp.Build(

  Exp.LE(Exp.IntBin("quantity"), Exp.Val(100)));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

exp := as.ExpLessEq(as.ExpIntBin("quantity"), as.ExpIntVal(100))
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.le(exp.binInt('quantity'), exp.int(100))
```

```c
as_exp_build(predexp,

  as_exp_cmp_le(as_exp_bin_int("quantity"), as_exp_int(100)));
```

```java
Expression exp = Exp.build(

  Exp.le(Exp.intBin("quantity"), Exp.val(100)));
```

```python
from aerospike_helpers.expressions import IntBin, LE

exp = LE(IntBin("quantity"), 100).compile()
```

---

#### `lt`

```python
lt(left, right)
```

Description: Returns `true` if the **left** is less than the **right**, otherwise returns `false`. **left** and **right** must result in the same fundamental type.

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `left` | `any` | 
Left operand. Any expression that evaluates to an integer, float, string, blob, boolean, list, or map. GeoJSON and HLL cannot be compared this way; for GeoJSON use [`cmp_geo`](#cmp_geo).

 |
| `right` | `any` | 

Right operand. Must evaluate to the same type as `left`.

 |

Returns: `boolean`

Introduced: 5.2.0.4

Example: Find records where float bin `price` is strictly below 10—the same “cheap book” threshold used in the [bookstore example](https://aerospike.com/docs/develop/expressions/path#bookstore-example) on the path expressions overview.

-   [Java SDK](#tab-panel-1336)
-   [Python SDK](#tab-panel-1337)
-   [Rust](#tab-panel-1338)
-   [C#](#tab-panel-1339)
-   [Go](#tab-panel-1340)
-   [Node.js](#tab-panel-1341)
-   [C](#tab-panel-1342)
-   [Java](#tab-panel-1343)
-   [Python](#tab-panel-1344)

```java
String exp = "$.price < 10.0";
```

```python
exp = "$.price < 10.0"
```

```rust
use aerospike::expressions::{float_bin, float_val, lt};

let exp = lt(float_bin("price".into()), float_val(10.0));
```

```csharp
Expression exp = Exp.Build(

  Exp.LT(Exp.FloatBin("price"), Exp.Val(10.0)));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

exp := as.ExpLess(as.ExpFloatBin("price"), as.ExpFloatVal(10.0))
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.lt(exp.binFloat('price'), exp.float(10.0))
```

```c
as_exp_build(predexp,

  as_exp_cmp_lt(as_exp_bin_float("price"), as_exp_float(10.0)));
```

```java
Expression exp = Exp.build(

  Exp.lt(Exp.floatBin("price"), Exp.val(10.0)));
```

```python
from aerospike_helpers.expressions import FloatBin, LT

exp = LT(FloatBin("price"), 10.0).compile()
```

---

#### `ne`

```python
ne(left, right)
```

Description: Returns `true` if the **left** is not equal to the **right**, otherwise returns `false`. **left** and **right** must result in the same fundamental type.

Arguments: | Name | Type | Description |
| --- | --- | --- |
| `left` | `any` | 
Left operand. Any expression that evaluates to an integer, float, string, blob, boolean, list, or map. GeoJSON and HLL cannot be compared this way; for GeoJSON use [`cmp_geo`](#cmp_geo).

 |
| `right` | `any` | 

Right operand. Must evaluate to the same type as `left`.

 |

Returns: `boolean`

Introduced: 5.2.0.4

Example: Find records where bin `age` does not hold an integer.

-   [Java SDK](#tab-panel-1345)
-   [Python SDK](#tab-panel-1346)
-   [Rust](#tab-panel-1347)
-   [C#](#tab-panel-1348)
-   [Go](#tab-panel-1349)
-   [Node.js](#tab-panel-1350)
-   [C](#tab-panel-1351)
-   [Java](#tab-panel-1352)
-   [Python](#tab-panel-1353)

```java
String exp = "$.age.type() != INT";
```

```python
exp = "$.age.type() != INT"
```

```rust
use aerospike::expressions::{bin_type, int_val, ne};

use aerospike::ParticleType;

let exp = ne(bin_type("age".into()), int_val(ParticleType::INTEGER as i64));
```

```csharp
Expression exp = Exp.Build(

  Exp.NE(Exp.BinType("age"), Exp.Val((long)ParticleType.INTEGER)));
```

```go
// Requires: import as "github.com/aerospike/aerospike-client-go/v8"

// Requires: import particleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type"

exp := as.ExpNotEq(as.ExpBinType("age"), as.ExpIntVal(particleType.INTEGER))
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.ne(exp.binType('age'), exp.int(1))
```

```c
as_exp_build(predexp,

  as_exp_cmp_ne(

    as_exp_bin_type("age"), as_exp_int(AS_BYTES_INTEGER)));
```

```java
// import com.aerospike.client.command.ParticleType;

Expression exp = Exp.build(

  Exp.ne(Exp.binType("age"), Exp.val(ParticleType.INTEGER)));
```

```python
import aerospike

from aerospike_helpers.expressions import BinType, NE

exp = NE(BinType("age"), aerospike.AS_BYTES_INTEGER).compile()
```

---