clojure-clutch / clutch

A Clojure library for Apache CouchDB.
Other
225 stars 37 forks source link

Add UUID defdbop #81

Open sritchie opened 10 years ago

sritchie commented 10 years ago
(defdbop uuids
  "Generates on UUID by default. Supply a second parameter to generate
   that many UUIDs."
  ([db]
     (let [url (assoc db :path "/_uuids")]
       (http/couchdb-request :get url)))
  ([db count]
     (let [url (assoc db :path (str "/_uuids?count=" count))]
       (http/couchdb-request :get url))))