 
 (defn scan
   "Retrieves items from a table (unindexed) with options:
-    :attr-conds     - {<attr> [<comparison-operator> <values>] ...}.
+    :attr-conds     - {<attr> [<comparison-operator> <val-or-vals>] ...}.
     :limit          - Max num >=1 of items to eval (≠ num of matching items).
                       Useful to prevent harmful sudden bursts of read activity.
     :last-prim-kvs  - Primary key-val from which to eval, useful for paging.

      utils/enum))

(defn- query|scan-conditions
  "{<attr> [operator <values>] ...} -> {<attr> Condition ...}"
  [conditions]
  (when (seq conditions)
    (utils/name-map
     (fn [[operator values :as condition]]
       (assert (coll?* values) (str "Malformed condition: " condition))
       (doto (Condition.)
         (.setComparisonOperator (enum-op operator))
         (.setAttributeValueList (mapv clj-val->db-val values))))
     conditions)))

(defn query
  "Retries items from a table (indexed) with options:
    prim-key-conds - {<key-attr> [<comparison-operator> <values>] ...}.
    :last-prim-kvs - Primary key-val from which to eval, useful for paging.
    :span-reqs     - {:max _ :throttle-ms _} controls automatic multi-request
                     stitching.

    :limit         - Max num >=1 of items to eval (≠ num of matching items).
                     Useful to prevent harmful sudden bursts of read activity.
    :consistent?   - Use strongly (rather than eventually) consistent reads?

  (create-table creds :my-table [:name :s] {:range-keydef [:age :n] :block? true})
  (do (put-item creds :my-table {:name \"Steve\" :age 24})
      (put-item creds :my-table {:name \"Susan\" :age 27}))
  (query creds :my-table {:name [:eq \"Steve\"]
                          :age  [:between [10 30]]})
  => [{:age 24, :name \"Steve\"}]

  comparison-operators e/o #{:eq :le :lt :ge :gt :begins-with :between}.

