Filter
in package
Query filter definition. Currently, only one filter is allowed in a Statement, and must be on a bin which has a secondary index defined.
Filter instances should be instantiated using one of the provided macros.
Table of Contents
Methods
- contains() : Filter
- NewContainsFilter creates a contains filter for query on collection index.
- containsRange() : Filter
- NewContainsRangeFilter creates a contains filter for query on ranges of data in a collection index.
- equal() : Filter
- NewEqualFilter creates a new equality filter instance for query.
- range() : Filter
- NewRangeFilter creates a range filter for query.
- regionsContainingPoint() : Filter
- NewGeoRegionsContainingPointFilter creates a geospatial "containing point" filter for query.
- withinRadius() : Filter
- NewGeoWithinRegionForCollectionFilter creates a geospatial "within region" filter for query on collection index.
- withinRegion() : Filter
- NewGeoWithinRegionFilter creates a geospatial "within region" filter for query.
Methods
contains()
NewContainsFilter creates a contains filter for query on collection index.
public
static contains(string $bin_name, mixed $value, IndexCollectionType|null $cit, array<string|int, mixed>|null $ctx) : Filter
Value can be an integer, string or a blob (byte array). Byte arrays are only supported on server v7+.
Parameters
- $bin_name : string
- $value : mixed
- $cit : IndexCollectionType|null
- $ctx : array<string|int, mixed>|null
Return values
FiltercontainsRange()
NewContainsRangeFilter creates a contains filter for query on ranges of data in a collection index.
public
static containsRange(string $bin_name, mixed $begin, mixed $end, IndexCollectionType|null $cit, array<string|int, mixed>|null $ctx) : Filter
Parameters
- $bin_name : string
- $begin : mixed
- $end : mixed
- $cit : IndexCollectionType|null
- $ctx : array<string|int, mixed>|null
Return values
Filterequal()
NewEqualFilter creates a new equality filter instance for query.
public
static equal(string $bin_name, mixed $value, array<string|int, mixed>|null $ctx) : Filter
Value can be an integer, string or a blob (byte array). Byte arrays are only supported on server v7+.
Parameters
- $bin_name : string
- $value : mixed
- $ctx : array<string|int, mixed>|null
Return values
Filterrange()
NewRangeFilter creates a range filter for query.
public
static range(string $bin_name, mixed $begin, mixed $end, array<string|int, mixed>|null $ctx) : Filter
Range arguments must be int64 values. String ranges are not supported.
Parameters
- $bin_name : string
- $begin : mixed
- $end : mixed
- $ctx : array<string|int, mixed>|null
Return values
FilterregionsContainingPoint()
NewGeoRegionsContainingPointFilter creates a geospatial "containing point" filter for query.
public
static regionsContainingPoint(string $bin_name, float $lat, float $lng, IndexCollectionType|null $cit, array<string|int, mixed>|null $ctx) : Filter
Argument must be a valid GeoJSON point.
Parameters
- $bin_name : string
- $lat : float
- $lng : float
- $cit : IndexCollectionType|null
- $ctx : array<string|int, mixed>|null
Return values
FilterwithinRadius()
NewGeoWithinRegionForCollectionFilter creates a geospatial "within region" filter for query on collection index.
public
static withinRadius(string $bin_name, float $lat, float $lng, float $radius, IndexCollectionType|null $cit, array<string|int, mixed>|null $ctx) : Filter
Argument must be a valid GeoJSON region.
Parameters
- $bin_name : string
- $lat : float
- $lng : float
- $radius : float
- $cit : IndexCollectionType|null
- $ctx : array<string|int, mixed>|null
Return values
FilterwithinRegion()
NewGeoWithinRegionFilter creates a geospatial "within region" filter for query.
public
static withinRegion(string $bin_name, string $region, IndexCollectionType|null $cit, array<string|int, mixed>|null $ctx) : Filter
Argument must be a valid GeoJSON region.
Parameters
- $bin_name : string
- $region : string
- $cit : IndexCollectionType|null
- $ctx : array<string|int, mixed>|null