              fi.iki.elonen.NanoWSD$WebSocket
              java.util.UUID
              com.couchbase.lite.Manager
+             com.couchbase.lite.Mapper
              com.couchbase.lite.Document$DocumentUpdater
              com.couchbase.lite.android.AndroidContext
              com.couchbase.lite.util.Log

    (def manager (Manager. (AndroidContext. (*a)) (.get (.getField Manager "DEFAULT_OPTIONS") nil)))
    (.setStorageType manager "ForestDB")
    (log/i "creteing database")
    (def db-name "player")
    (def database (.getDatabase manager db-name))
    (log/i "creating document")
    (def document (.createDocument database))
    (log/i "getting doc-id")
    (def doc-id (.getId document))
    (.putProperties document {"hello" "[1] this is an hello test couchbase example"})
    (def data (.getProperties document))
    (log/i (str "first data: " data))
    (log/i "updating data using putProperties")
    (.putProperties document (assoc (into {}  data) "hello" "test" "itzik" "there"))
    (log/i (str "new data after using putProperties: " (.getProperties document)))

    (log/i "updating data using update method hendler")

                      (log/i "calling setUserProperties")
                      (.setUserProperties new-revision 
                                          (assoc (into {}  properties) 
                                                 "name" "loco" "phone" "03649556"))
                      true
                          )))]
    updater
    )
  )

(defn document-mapper
  []
  (let [mapper (proxy [Mapper] []
                 (map 
                   [document, emitter]
                   (log/i "testing mapper view function")
                   (log/i (str "mapper:" document))
                   (.emit emitter (get document "phone") (get document "name"))
                   ))]
    mapper
    )
  )

;; --API-- ;;
(defprotocol I-HTTPD-WSD
  "HTTPD and WSD APIs"
