Example dataset:
(def data
(icore/dataset
[:foo :bar :baz :quux]
[[0 0 0 0]
[1 1 1 1]
[2 2 2 2]]))
Example query with result:
(icore/$where {:baz {:fn #(> % 1)}} data)
| :foo | :bar | :baz | :quux |
|------+------+------+-------|
| 2 | 2 | 2 | 2 |
Actually this could also be written
(icore/$where {:baz {:gt 1}} data)
Several such "predicate keywords" are support apart from :gt
: :lt
, :lte
, :gte
, :eq
(corresponding to Clojure's =
), :ne
(not=
), :in
, :nin
(not in).
:fn
is the general "use any function" keyword.
All of these can be prefixed with $
(:$fn
etc.) with no change in meaning.