ejsQueryFilter

Wraps any query to be used as a filter. Can be placed within queries that accept a filter.

The result of the filter is not cached by default. Set the cache parameter to true to cache the result of the filter. This is handy when the same query is used on several (many) other queries.

Note, the process of caching the first execution is higher when not caching (since it needs to satisfy different queries).

Module

 QueryFilter

QueryFilter ( qry )
Filters documents matching the wrapped query.

Parameters
qry <Object> A valid query object.

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
Objectcache(trueFalse)Enable or disable caching of the filter
ObjectcacheKey(key)Sets the cache key.
Objectname(name)Sets the filter name.
Objectquery(q)Sets the query
ObjecttoJSON()Returns the filter object.

Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 cache

Object cache ( trueFalse )
Enable or disable caching of the filter

Parameters
trueFalse <Boolean> True to cache the filter, false otherwise.
Returns
returns this so that calls can be chained.

 cacheKey

Object cacheKey ( key )
Sets the cache key.

Parameters
key <String> the cache key as a string.
Returns
returns this so that calls can be chained.

 name

Object name ( name )
Sets the filter name.

Parameters
name <String> A name for the filter.
Returns
returns this so that calls can be chained.

 query

Object query ( q )
Sets the query

Parameters
q <Object> A valid Query object
Returns
returns this so that calls can be chained.

 toJSON

Object toJSON ( )
Returns the filter object.

Returns
filter object

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo