Filter

flitter-orm/src/filter/Filter~ Filter

An accumulating MongoDB filter object.


Constructor

new Filter()

Members

_model

The model in question.

(private) _root :object

The root query object.

Type:
  • object

Methods

(private) __exec_resolve(object) → {object}

Resolve the filter object from structures to primitives.

Parameters:
Name Type Description
object object
Returns:
Type
object

(private) _unfocus(focus) → {module:flitter-orm/src/filter/Filter~Filter}

Callback to break a field's focus and merge the filters for that field into this filter.

Parameters:
Name Type Description
focus module:flitter-orm/src/filter/Focus~Focus

absorb(other) → {module:flitter-orm/src/filter/Filter~Filter}

Merge this filter with another.

Parameters:
Name Type Description
other module:flitter-orm/src/filter/Filter~Filter

clone() → {module:flitter-orm/src/filter/Filter~Filter}

Clone this filter into a new filter instance. Ensures that modifications to the cloned filter do no affect this existing filter.

end() → {module:flitter-orm/src/proxy/model/FilterProxy~FilterProxy}

End the filter and apply it to the model's proxy.

equal(field, value) → {module:flitter-orm/src/filter/Filter~Filter}

Asserts that a field must equal the value.

Parameters:
Name Type Description
field string
value *

field(field) → {module:flitter-orm/src/filter/Focus~Focus}

Focus on a particular field.

Parameters:
Name Type Description
field string

greater_than(field, value) → {module:flitter-orm/src/filter/Filter~Filter}

Asserts that a field must be greater than the value.

Parameters:
Name Type Description
field string
value *

in(field, value) → {module:flitter-orm/src/filter/Filter~Filter}

Asserts that a field must be in the array of options for the value.

Parameters:
Name Type Description
field string
value *

less_than(field, value) → {module:flitter-orm/src/filter/Filter~Filter}

Asserts that a field must be less than the value.

Parameters:
Name Type Description
field string
value *

less_than_equal(field, value) → {module:flitter-orm/src/filter/Filter~Filter}

Asserts that a field must be less than or equal to the value.

Parameters:
Name Type Description
field string
value *

write() → {object}

Write the accumulated filter to a MongoDB compatible filter object.

Returns:
Type
object