Skip to content

Latest commit

 

History

History
69 lines (50 loc) · 1.71 KB

filters.md

File metadata and controls

69 lines (50 loc) · 1.71 KB

Filters

Filters object provides functions to easily apply filters to be performed on a given query via query() function

Example:

var filter = aerospike.filters

var queryArgs = { filters = [
					filter.equal('a', 'hello'),
					filter.equal('b', 123),
					filter.range('c', 1, 1000)
				  ]
}

client.query(ns, set, queryArgs)

Functions

equal(bin, value)

Apply an equality filter criteria on a bin that is indexed. The bin must contain either String or Integer, and the value must be of the same type.

Parameters:

  • bin – The name of the bin to apply the filter to.
  • value – The equality of this value will be checked for the given bin.
filter.equal('a', 'hello')
filter.equal('b', 123)

range(bin, min, max)

Apply a range filter criteria on a bin that is indexed. The bin must contain an Integer, and the value must be of the same type.

Parameters:

  • bin – The name of the bin to apply the filter to.
  • min – The minimum value of the bin, the records with bin value greater than min will be returned as part of query result.
  • max - The maximum value of the bin, the records with bin value less than max will be returned as part of query result.
filter.range('b', 1, 1000)