Module: aerospike/predexp

This module defines predicate expression that provide a mechanism for additional filtering on the resultset of a secondary index query or scan operation.

PredicateExpression filtering requires Aerospike Server version 3.12 or later.

For more information, please refer to the ⇑PredicateExpression Filtering documentation in the Aerospike Feature Guide.

Source:
See:

Classes

PredicateExpression

Methods


<static> and(nexpr)

Create an AND logical predicate expression.

The AND predicate expression returns true if all of its children are true.

The nexpr parameter specifies how many children to pop off the expression stack. These children must be "logical" expressions and not "value" expressions.

Parameters:
Name Type Description
nexpr number

The number of child expressions to AND.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the value of bin "c" is between 11 and 20 inclusive:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.integerBin('c'),
  predexp.integerValue(11),
  predexp.integerGreaterEq(),
  predexp.integerBin('c'),
  predexp.integerValue(20),
  predexp.integerLessEq(),
  predexp.and(2)
]

<static> geojsonBin(bin)

Create a GeoJSON bin value predicate expression.

The GeoJSON bin predicate expression pushes a single GeoJSON bin value onto the expression stack.

Parameters:
Name Type Description
bin GeoJSON

The name of the bin.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where a point in bin "loc" is inside the specified polygon:

const Aerospike = require('aerospike')
const GeoJSON = Aerospike.GeoJSON
const predexp = Aerospike.predexp

let region = GeoJSON.Polygon(
  [-122.500000, 37.000000], [-121.000000, 37.000000],
  [-121.000000, 38.080000], [-122.500000, 38.080000],
  [-122.500000, 37.000000])

let exp = [
  predexp.geojsonBin('loc'),
  predexp.geojsonValue(region),
  predexp.geoWithin()
]

<static> geojsonContains()

Create an GeoJSON Regions-Containing-Point logical predicate expression.

The Regions-Containing-Point (contains) expression pops two children off the expression stack and checks to see if a child GeoJSON region contains a specified GeoJSON point. The left child (pushed earlier) must contain a GeoJSON value specifying a possibly enclosing region. The right child (pushed later) must be a GeoJSON value containing a point.

If the value of the left child is unknown because a specified bin does not exist or contains a value of the wrong type the result of the contains expression is false.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where a point in bin "rgn" contains the specified query point:

const Aerospike = require('aerospike')
const GeoJSON = Aerospike.GeoJSON
const predexp = Aerospike.predexp

let point = GeoJSON.Point(-122.0986857, 37.4214209)

let exp = [
  predexp.geojsonBin('rgn'),
  predexp.geojsonValue(point),
  predexp.geoContains()
]

<static> geojsonValue(value)

Create a constant GeoJSON value predicate expression.

The GeoJSON value predicate expression pushes a single constant string value onto the expression stack.

Parameters:
Name Type Description
value GeoJSON

The GeoJSON value.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where a point in bin "loc" is inside the specified polygon:

const Aerospike = require('aerospike')
const GeoJSON = Aerospike.GeoJSON
const predexp = Aerospike.predexp

let region = GeoJSON.Polygon(
  [-122.500000, 37.000000], [-121.000000, 37.000000],
  [-121.000000, 38.080000], [-122.500000, 38.080000],
  [-122.500000, 37.000000])

let exp = [
  predexp.geojsonBin('loc'),
  predexp.geojsonValue(region),
  predexp.geoWithin()
]

<static> geojsonVar(name)

Create a GeoJSON iteration variable (value) predicate expression.

The GeoJSON iteration variable is used in the subexpression child of a list or map iterator and takes the value of each element in the collection as it is traversed.

Parameters:
Name Type Description
name string

The name of the iteration variable.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression

<static> geojsonWithin()

Create a GeoJSON Points-in-Region logical predicate expression.

The Points-in-Region (within) expression pops two children off the expression stack and checks to see if a child GeoJSON point is inside a specified GeoJSON region. The left child (pushed earlier) must contain a GeoJSON value specifying a point. The right child (pushed later) must be a GeoJSON value containing a region.

If the value of the left child is unknown because a specified bin does not exist or contains a value of the wrong type the result of the within expression is false.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where a point in bin "loc" is inside the specified polygon:

const Aerospike = require('aerospike')
const GeoJSON = Aerospike.GeoJSON
const predexp = Aerospike.predexp

let region = GeoJSON.Polygon(
  [-122.500000, 37.000000], [-121.000000, 37.000000],
  [-121.000000, 38.080000], [-122.500000, 38.080000],
  [-122.500000, 37.000000])

let exp = [
  predexp.geojsonBin('loc'),
  predexp.geojsonValue(region),
  predexp.geoWithin()
]

<static> integerBin(bin)

Create a integer bin value predicate expression.

The integer bin predicate expression pushes a single integer bin value extractor onto the expression stack.

Parameters:
Name Type Description
bin String

The name of the bin.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the value of bin "c" is between 11 and 20 inclusive:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.integerBin('c'),
  predexp.integerValue(11),
  predexp.integerGreaterEq(),
  predexp.integerBin('c'),
  predexp.integerValue(20),
  predexp.integerLessEq(),
  predexp.and(2)
]

<static> integerEqual()

Create an integer comparison logical predicate expression.

The integer comparison expressions pop a pair of value expressions off the expression stack and compare them. The deeper of the two child expressions (pushed earlier) is considered the left side of the expression and the shallower (pushed later) is considered the right side.

If the value of either of the child expressions is unknown because a specified bin does not exist or contains a value of the wrong type the result of the comparison is false. If a true outcome is desirable in this situation use the complimentary comparison and enclose in a logical NOT.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records that have bin "foo" equal to 42:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.integerBin('foo'),
  predexp.integerValue(42),
  predexp.integerEqual()
]

<static> integerGreater()

Create an integer comparison logical predicate expression.

Source:
See:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression

<static> integerGreaterEq()

Create an integer comparison logical predicate expression.

Source:
See:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression

<static> integerLess()

Create an integer comparison logical predicate expression.

Source:
See:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression

<static> integerLessEq()

Create an integer comparison logical predicate expression.

Source:
See:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression

<static> integerUnequal()

Create an integer comparison logical predicate expression.

Source:
See:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression

<static> integerValue(value)

Create a constant integer value predicate expression.

The integer value predicate expression pushes a single constant integer value onto the expression stack.

Parameters:
Name Type Description
value number

The integer value.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the value of bin "c" is between 11 and 20 inclusive:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.integerBin('c'),
  predexp.integerValue(11),
  predexp.integerGreaterEq(),
  predexp.integerBin('c'),
  predexp.integerValue(20),
  predexp.integerLessEq(),
  predexp.and(2)
]

<static> integerVar(name)

Create an integer iteration variable (value) predicate expression.

The integer iteration variable is used in the subexpression child of a list or map iterator and takes the value of each element in the collection as it is traversed.

Parameters:
Name Type Description
name string

The name of the iteration variable.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the list contains a value of 42:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.integerVar('item'),
  predexp.integerValue(42),
  predexp.integerEqual(),
  predexp.listBin('numbers'),
  predexp.listIterateOr('item')
]

<static> listBin(bin)

Create a list bin value predicate expression.

The list bin predicate expression pushes a single list bin value extractor onto the expression stack. List bin values may be used with list iteration expressions to evaluate a subexpression for each of the elements of the list.

Parameters:
Name Type Description
bin GeoJSON

The name of the bin.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where one of the list items is cat:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringVar('item'),
  predexp.stringEqual(),
  predexp.listBin('pets')
  predexp.listIterateOr('item')
]

<static> listIterateAnd()

Create a list iteration AND logical predicate expression.

The list iteration expression pops two children off the expression stack. The left child (pushed earlier) must contain a logical subexpression containing one or more matching iteration variable expressions. The right child (pushed later) must specify a list bin. The list iteration traverses the list and repeatedly evaluates the subexpression substituting each list element's value into the matching iteration variable. The result of the iteration expression is a logical AND of all of the individual element evaluations.

If the list bin contains zero elements, the list iterate AND expression will return true. This is useful when testing for exclusion (see example).

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where none of the list items is "cat":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringVar('item'),
  predexp.stringEqual(),
  predexp.not(),
  predexp.listBin('pets')
  predexp.listIterateAnd('item')
]

<static> listIterateOr()

Create a list iteration OR logical predicate expression.

The list iteration expression pops two children off the expression stack. The left child (pushed earlier) must contain a logical subexpression containing one or more matching iteration variable expressions. The right child (pushed later) must specify a list bin. The list iteration traverses the list and repeatedly evaluates the subexpression substituting each list element's value into the matching iteration variable. The result of the iteration expression is a logical OR of all of the individual element evaluations.

If the list bin contains zero elements, the list iterate OR expression will return false.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where one of the list items is "cat":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringVar('item'),
  predexp.stringEqual(),
  predexp.listBin('pets')
  predexp.listIterateOr('item')
]

<static> mapBin(bin)

Create a map bin value predicate expression.

The map bin predicate expression pushes a single map bin value extractor onto the expression stack. Map bin values may be used with map iteration expressions to evaluate a subexpression for each of the elements of the map.

Parameters:
Name Type Description
bin GeoJSON

The name of the bin.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the map contains a key of "cat":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringVar('key'),
  predexp.stringEqual(),
  predexp.mapBin('pets')
  predexp.mapkeyIterateOr('key')
]

<static> mapKeyIterateAnd()

Create a map key iteration AND logical predicate expression.

The map key iteration expression pops two children off the expression stack. The left child (pushed earlier) must contain a logical subexpression containing one or more matching iteration variable expressions. The right child (pushed later) must specify a map bin. The map key iteration traverses the map and repeatedly evaluates the subexpression substituting each map key value into the matching iteration variable. The result of the iteration expression is a logical AND of all of the individual element evaluations.

If the map bin contains zero elements, the map key iterate AND expression will return true. This is useful when testing for exclusion (see example).

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where none of the map keys is "cat":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringVar('item'),
  predexp.stringEqual(),
  predexp.not(),
  predexp.mapBin('pets')
  predexp.mapkeyIterateAnd('item')
]

<static> mapKeyIterateOr()

Create a map key iteration OR logical predicate expression.

The map key iteration expression pops two children off the expression stack. The left child (pushed earlier) must contain a logical subexpression containing one or more matching iteration variable expressions. The right child (pushed later) must specify a map bin. The map key iteration traverses the map and repeatedly evaluates the subexpression substituting each map key value into the matching iteration variable. The result of the iteration expression is a logical OR of all of the individual element evaluations.

If the map bin contains zero elements, the map key iterate OR expression will return false.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where one of the map keys is "cat":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringVar('item'),
  predexp.stringEqual(),
  predexp.mapBin('pets')
  predexp.mapkeyIterateOr('item')
]

<static> mapValIterateAnd()

Create a map value iteration AND logical predicate expression.

The map value iteration expression pops two children off the expression stack. The left child (pushed earlier) must contain a logical subexpression containing one or more matching iteration variable expressions. The right child (pushed later) must specify a map bin. The map value iteration traverses the map and repeatedly evaluates the subexpression substituting each map value into the matching iteration variable. The result of the iteration expression is a logical AND of all of the individual element evaluations.

If the map bin contains zero elements, the map value iterate OR expression will return true. This is useful when testing for exclusion (see example).

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where none of the map values is 0:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.integerValue(0),
  predexp.integerVar('count'),
  predexp.integerEqual(),
  predexp.not(),
  predexp.mapBin('petcount')
  predexp.mapvalue('count')
]

<static> mapValIterateOr()

Create a map value iteration OR logical predicate expression.

The map value iteration expression pops two children off the expression stack. The left child (pushed earlier) must contain a logical subexpression containing one or more matching iteration variable expressions. The right child (pushed later) must specify a map bin. The map value iteration traverses the map and repeatedly evaluates the subexpression substituting each map value into the matching iteration variable. The result of the iteration expression is a logical OR of all of the individual element evaluations.

If the map bin contains zero elements, the map value iterate OR expression will return false.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where one of the map values is 0:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.integerValue(0),
  predexp.integerVar('count'),
  predexp.integerEqual(),
  predexp.mapBin('petcount')
  predexp.mapvalue('count')
]

<static> not()

Create a NOT logical predicate expression.

The NOT predicate expression returns true if its child is false.

The NOT expression pops a single child off the expression stack. This child must be a "logical" expression and not a "value" expression.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the value of bin "pet" is not "dog":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('dog'),
  predexp.stringBin('pet'),
  predexp.stringEqual(),
  predexp.not()
]

<static> or(nexpr)

Create an OR logical predicate expression.

The OR predicate expression returns true if any of its children are true.

The nexpr parameter specifies how many children to pop off the expression stack. These children must be "logical" expressions and not "value" expressions.

Parameters:
Name Type Description
nexpr number

The number of child expressions to OR.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the value of bin "pet" is "cat" or "dog":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringBin('pet'),
  predexp.stringEqual(),
  predexp.stringValue('dog'),
  predexp.stringBin('pet'),
  predexp.stringEqual(),
  predexp.or(2)
]

<static> recDeviceSize()

Create a record device size metadata value predicate expression.

The record device size expression assumes the value of the size in bytes that the record occupies on device storage. For non-persisted records, this value is 0.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records whose device storage size is larger than 65K:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.recDeviceSize(),
  predexp.integerValue(65 * 1024),
  predexp.integerGreater()
]

<static> recDigestModulo(mod)

Create a digest modulo record metadata value predicate expression.

The digest modulo expression assumes the value of 4 bytes of the record's key digest modulo it's modulus argument.

Parameters:
Name Type Description
mod number

The modulus argument.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where digest(key) % 3 == 1:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.recDigestModulo(3),
  predexp.integerValue(1),
  predexp.integerEqual()
]

<static> recLastUpdate()

Create a last update record metadata value predicate expression.

The record last update expression assumes the value of the number of nanoseconds since the unix epoch that the record was last updated.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records that have been updated after a given timestamp:

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let timestampNS = ... # cut-off time in ns since Unix epoch

let exp = [
  predexp.recLastUpdate(),
  predexp.integerValue(timestampNS),
  predexp.integerGreater()
]

<static> recVoidTime()

Create a void time record metadata value predicate expression.

The record void time expression assumes the value of the number of nanoseconds since the unix epoch when the record will expire. The special value of 0 means the record will not expire.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records that have void time set to 0 (no expiration):

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.recVoidTime(),
  predexp.integerValue(0),
  predexp.integerEqual()
]

<static> stringBin(bin)

Create a string bin value predicate expression.

The string bin predicate expression pushes a single string bin value onto the expression stack.

Parameters:
Name Type Description
bin number

The name of the bin.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the value of bin "pet" is "cat" or "dog":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringBin('pet'),
  predexp.stringEqual(),
  predexp.stringValue('dog'),
  predexp.stringBin('pet'),
  predexp.stringEqual(),
  predexp.or(2)
]

<static> stringEqual()

Create a string comparison logical predicate expression.

The string comparison expressions pop a pair of value expressions off the expression stack and compare them. The deeper of the two child expressions (pushed earlier) is considered the left side of the expression and the shallower (pushed later) is considered the right side.

If the value of either of the child expressions is unknown because a specified bin does not exist or contains a value of the wrong type the result of the comparison is false. If a true outcome is desirable in this situation use the complimentary comparison and enclose in a logical NOT.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records that have bin "pet" equal to "cat":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringBin('pet'),
  predexp.stringValue('cat'),
  predexp.stringEqual()
]

<static> stringRegex( [flags])

Create a string regular expression logical predicate expression.

The string regex expression pops two children off the expression stack and compares a child value expression to a regular expression. The left child (pushed earlier) must contain the string value to be matched. The right child (pushed later) must be a string value containing a valid regular expression.

If the value of the left child is unknown because a specified bin does not exist or contains a value of the wrong type the result of the regex match is false.

The flags argument is passed to the regcomp library routine on the server. The supported flags are defined in the module:aerospike.regex enum and can be used to toggle between basic and extended POSIX regular expression syntax, enable case-insensitive matching, etc.

Parameters:
Name Type Argument Default Description
flags number <optional>
Aerospike.regex.BASIC

POSIX regex compilation flags.

Source:
See:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records that have bin "hex" value ending in '1' or '2':

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringBin('hex'),
  predexp.stringValue('0x00.[12]'),
  predexp.stringRegex(Aerospike.regex.ICASE)
]

<static> stringUnequal()

Create a string comparison logical predicate expression.

Source:
See:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression

<static> stringValue(value)

Create a constant string value predicate expression.

The string value predicate expression pushes a single constant string value onto the expression stack.

Parameters:
Name Type Description
value number

The string value.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where the value of bin "pet" is "cat" or "dog":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringValue('cat'),
  predexp.stringBin('pet'),
  predexp.stringEqual(),
  predexp.stringValue('dog'),
  predexp.stringBin('pet'),
  predexp.stringEqual(),
  predexp.or(2)
]

<static> stringVar(name)

Create a string iteration variable (value) predicate expression.

The string iteration variable is used in the subexpression child of a list or map iterator and takes the value of each element in the collection as it is traversed.

Parameters:
Name Type Description
name string

The name of the iteration variable.

Source:
Returns:

A predicate expression that can be applied to queries using Query#where.

Type
module:aerospike/predexp~PredicateExpression
Example

The following sequence of predicate expressions selects records where one of the list items is "cat":

const Aerospike = require('aerospike')
const predexp = Aerospike.predexp

let exp = [
  predexp.stringVar('item'),
  predexp.stringValue('cat'),
  predexp.stringEqual(),
  predexp.listBin('pets'),
  predexp.listIterateOr('item')
]