Skip to content

xavierchow/clojure-couchbase

Repository files navigation

clojure-couchbase

clojure-couchbase

A Clojure library for Couchbase 7 with SDK 3.x.

Usage

(require '[clojure-couchbase.cluster :as clus]
         '[clojure-couchbase.collection :as col])

(def cluster (clus/connect "couchbase://localhost" username password))
(def collection (col/get-collection cluster test-bucket))

;; insert doc
(col/upsert collection id  {:a 1 :b 2})

;; read doc
(col/get collection id)
  ;; => { :content {:a 1 :b 2} }

(clus/query cluster "SELECT b.* FROM `bucket-name` b where name = \"smith\"")
  ;; => { :status  QueryStatus/SUCCESS :rows [{:foo "xxx" :name "smith"}]}

;; tear down
(clus/disconnect cluster)

How to run test code

lein deps
./docker/up.sh
lein test

License

MIT

About

The clojure sdk for Couchbase7

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published