ejsScriptFilter

A filter allowing to define scripts as filters

Module

 ScriptFilter

ScriptFilter ( script )
A filter allowing to define scripts as filters.

Parameters
script <String> The script as a string.

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.
Objectlang(lang)Sets the script language.
Objectname(name)Sets the filter name.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites any existing params.
Objectscript(s)Sets the script.
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.

 lang

Object lang ( lang )
Sets the script language.

Parameters
lang <String> The script language, default mvel.
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.

 params

Object params ( p )
Sets parameters that will be applied to the script. Overwrites any existing params.

Parameters
p <Object> An object where the keys are the parameter name and values are the parameter value.
Returns
returns this so that calls can be chained.

 script

Object script ( s )
Sets the script.

Parameters
s <String> The script as a string.
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