An alias to (query-dataset (second args) (first args)). If given only a single argument,
it will use the $data binding for the first argument, which is set with
the with-data macro.
Examples:
(use '(incanter core datasets))
(def cars (get-dataset :cars))
($where {:speed 10} cars)
;; use the with-data macro and the one arg version of $where
(with-data cars
(view ($where {:speed {:$gt -10 :$lt 10}}))
(view ($where {:dist {:$in #{10 12 16}}}))
(view ($where {:dist {:$nin #{10 12 16}}})))
;; create a dataset where :speed greater than 10 or less than -10
(with-data (get-dataset :cars)
(view (-> ($where {:speed {:$gt 20}})
(conj-rows ($where {:speed {:$lt 10}})))))
Comments top
No comments for $where. Log in to add a comment.