Secondary-index predicate values for query builders.
Use range/3, equal/2, contains/3, geo_within/2, or
geo_contains/2 to build a predicate, then pass it to
Aerospike.Query.where/2.
using_index/2 targets a named index, and with_ctx/2 carries nested
CDT context for context-aware predicates.
Summary
Types
Collection secondary-index kind accepted by contains/3.
GeoJSON input accepted by geospatial query filters.
Secondary-index filter kind encoded for the query predicate.
Indexed scalar particle type inferred for integer and string predicates.
Scalar value accepted by equality and CDT membership filters.
Secondary-index query filter consumed by Aerospike.Query.where/2.
Functions
CDT membership filter for list or map indexes.
Equality on a bin. The particle type is inferred from the value.
Geo point query for regions containing a GeoJSON point.
Builds a geo_contains/2 point query from longitude and latitude.
Geo region query for points within a GeoJSON region.
Builds a geo_within/2 circle query from center longitude, latitude, and radius.
Numeric range on a bin, inclusive.
Targets a named secondary index.
Attaches nested CDT context to the filter.
Types
@type collection_index_type() :: :list | :mapkeys | :mapvalues
Collection secondary-index kind accepted by contains/3.
@type geo_geometry() :: String.t() | Aerospike.Geo.Point.t() | Aerospike.Geo.Polygon.t() | Aerospike.Geo.Circle.t()
GeoJSON input accepted by geospatial query filters.
Binary inputs are expected to be non-empty GeoJSON strings. Typed
Aerospike.Geo values are converted with Aerospike.Geo.to_json/1.
@type index_type() ::
:default | :list | :mapkeys | :mapvalues | :geo_within | :geo_contains
Secondary-index filter kind encoded for the query predicate.
:list, :mapkeys, and :mapvalues target CDT collection indexes.
:geo_within and :geo_contains target geospatial predicates.
@type particle_type() :: :integer | :string
Indexed scalar particle type inferred for integer and string predicates.
Scalar value accepted by equality and CDT membership filters.
@type t() :: %Aerospike.Filter{ begin: term(), bin_name: String.t(), ctx: [Aerospike.Ctx.step()] | nil, end: term(), index_name: String.t() | nil, index_type: index_type(), particle_type: particle_type() }
Secondary-index query filter consumed by Aerospike.Query.where/2.
A query can carry one secondary-index filter. index_name is optional and is
set by using_index/2; ctx is optional nested-CDT context set by
with_ctx/2.
Functions
@spec contains(String.t(), collection_index_type(), scalar_value()) :: t()
CDT membership filter for list or map indexes.
index_type must match the collection index created for the bin:
:list, :mapkeys, or :mapvalues.
@spec equal(String.t(), scalar_value()) :: t()
Equality on a bin. The particle type is inferred from the value.
Supports integer and string values. Integer values must fit in Aerospike's signed int64 range.
@spec geo_contains(String.t(), geo_geometry()) :: t()
Geo point query for regions containing a GeoJSON point.
Use this with a :geo2dsphere index on region data. The point may be a
GeoJSON string or a typed Aerospike.Geo value.
Builds a geo_contains/2 point query from longitude and latitude.
@spec geo_within(String.t(), geo_geometry()) :: t()
Geo region query for points within a GeoJSON region.
Use this with a :geo2dsphere index on point data. The region may be a
GeoJSON string or a typed Aerospike.Geo value.
Builds a geo_within/2 circle query from center longitude, latitude, and radius.
Numeric range on a bin, inclusive.
begin_val and end_val must fit in Aerospike's signed int64 range.
Raises ArgumentError when the bin name is empty, a value is out of range,
or the range is inverted.
Targets a named secondary index.
Use this when the server has multiple compatible indexes and the query should address one index explicitly.
@spec with_ctx(t(), [Aerospike.Ctx.step()]) :: t()
Attaches nested CDT context to the filter.
ctx must be a non-empty list of Aerospike.Ctx steps that points at the
nested collection value indexed by the server.