(create couch namespace key value)
Create a new document containing an encoded Clojure value in the namespace.
nil
will be returned.Create a new document containing an encoded Clojure value in the namespace. - The namespace must already exist. - The document must NOT already exist for the key. - If successful, the value passed in will be returned along with an updated check-and-set (CAS) token. - If unable to create the document, `nil` will be returned.
(create* couch namespace key value)
Attempt to create a new document containing an encoded Clojure value in the namespace.
Success
.Failure
will be returned.Attempt to create a new document containing an encoded Clojure value in the namespace. - The namespace must already exist. - The document must NOT already exist for the key. - If successful, the value passed in will be returned along with an updated check-and-set (CAS) token wrapped in a `Success`. - If unable to create the document, a `Failure` will be returned.
(delete couch namespace key cas)
Safely delete a document in the namespace.
lookup
operation.true
if successful, false
if not.Safely delete a document in the namespace. - A check-and-set (CAS) token must be supplied which matches the existing token for the document. - The CAS token can be obtained by performing a `lookup` operation. - Returns `true` if successful, `false` if not.
(delete* couch namespace key cas)
Attempt to safely delete a document in the namespace.
lookup
operation.true
wrapped in a Success
if successful, a Failure
if not.Attempt to safely delete a document in the namespace. - A check-and-set (CAS) token must be supplied which matches the existing token for the document. - The CAS token can be obtained by performing a `lookup` operation. - Returns `true` wrapped in a `Success` if successful, a `Failure` if not.
(destroy couch namespace key)
Unsafely delete a document in the namespace.
Because this operation is not protected by a check-and-set (CAS) token, there is a potential to silently lose changes stored simultaneously by another client or thread.
true
if successful, false
if not.Unsafely delete a document in the namespace. Because this operation is not protected by a check-and-set (CAS) token, there is a potential to silently lose changes stored simultaneously by another client or thread. - Returns `true` if successful, `false` if not.
(destroy* couch namespace key)
Attempt to unsafely delete a document in the namespace.
Because this operation is not protected by a check-and-set (CAS) token, there is a potential to silently lose changes stored simultaneously by another client or thread.
true
wrapped in a Success
if successful, a Failure
if not.Attempt to unsafely delete a document in the namespace. Because this operation is not protected by a check-and-set (CAS) token, there is a potential to silently lose changes stored simultaneously by another client or thread. - Returns `true` wrapped in a `Success` if successful, a `Failure` if not.
(exists? couch namespace key)
Tests for the existance of a document in the namespace.
true
if the document is found, false
if not.Tests for the existance of a document in the namespace. - Returns `true` if the document is found, `false` if not.
(expire kv namespace key ttl)
Sets the expiration for the document with the specified key
to ttl
seconds
in the future.
true
if successful, false if not.Sets the expiration for the document with the specified `key` to `ttl` seconds in the future. - Returns `true` if successful, false if not.
(fetch couch namespace key)
Retrieve the Clojure value encoded in a document in the namespace.
nil
will be returned.Retrieve the Clojure value encoded in a document in the namespace. - If successful, returns the value alone. The check-and-set (CAS) token is discarded. - If unable to find the document, `nil` will be returned.
(fetch* couch namespace key)
Attempt to retrieve the Clojure value encoded in a document in the namespace.
Success
. The
check-and-set (CAS) token is discarded.Failure
will be returned.Attempt to retrieve the Clojure value encoded in a document in the namespace. - If successful, returns the value alone wrapped in a `Success`. The check-and-set (CAS) token is discarded. - If unable to find the document, a `Failure` will be returned.
(lookup couch namespace key)
Retrieve the Clojure value encoded in a document in the namespace.
nil
will be returned.Retrieve the Clojure value encoded in a document in the namespace. - If successful, returns the value along with a check-and-set (CAS) token. - If unable to find the document, `nil` will be returned.
(lookup* couch namespace key)
Attempt to retrieve the Clojure value encoded in a document in the namespace.
Success
.Failure
will be returned.Attempt to retrieve the Clojure value encoded in a document in the namespace. - If successful, returns the value along with a check-and-set (CAS) token wrapped in a `Success`. - If unable to find the document, a `Failure` will be returned.
(set-add couch name value)
Add a string to the named set.
true
if successful, false
if not.Add a string to the named set. - Returns `true` if successful, `false` if not.
(set-add* couch name value)
Attempt to add a string to the named set.
true
wrapped in a Success
if successful, a Failure
if not.Attempt to add a string to the named set. - Returns `true` wrapped in a `Success` if successful, a `Failure` if not.
(set-contents couch name)
Get all of the strings in the named set.
nil
if not.Get all of the strings in the named set. - Returns the set if successful, `nil` if not.
(set-contents* couch name)
Attempt to get all of the strings in the named set.
Success
if successful, a Failure
if not.Attempt to get all of the strings in the named set. - Returns the set wrapped in `Success` if successful, a `Failure` if not.
(set-create couch name)
Create a new named set of strings.
true
if successful, false
if not.Create a new named set of strings. - Returns `true` if successful, `false` if not.
(set-create* couch name)
Attempt to create a new named set of strings.
true
wrapped in a Success
if successful, a Failure
if not.Attempt to create a new named set of strings. - Returns `true` wrapped in a `Success` if successful, a `Failure` if not.
(set-destroy couch name)
Unsafely delete an existing named set of strings.
true
if successful, false
if not.Unsafely delete an existing named set of strings. - Returns `true` if successful, `false` if not.
(set-destroy* couch name)
Attempt to unsafely delete an existing named set of strings.
true
wrapped in a Success
if successful, a Failure
if not.Attempt to unsafely delete an existing named set of strings. - Returns `true` wrapped in a `Success` if successful, a `Failure` if not.
(set-exists? couch namespace)
Tests for the existance of a named set of strings.
true
if the set is found, false
if not.Tests for the existance of a named set of strings. - Returns `true` if the set is found, `false` if not.
(set-refresh couch name)
Rebuild the entire contents of the set using the Couchbase view of all keys in the bucket.
WARNING: This will overwrite any existing members of the set.
true
if successful, false
if not.Rebuild the entire contents of the set using the Couchbase view of all keys in the bucket. WARNING: This will overwrite any existing members of the set. - Returns `true` if successful, `false` if not.
(set-refresh* couch name)
Attempt to rebuild the entire contents of the set using the Couchbase view of all keys in the bucket.
WARNING: This will overwrite any existing members of the set.
true
wrapped in a Success
if successful, a Failure
if not.Attempt to rebuild the entire contents of the set using the Couchbase view of all keys in the bucket. WARNING: This will overwrite any existing members of the set. - Returns `true` wrapped in a `Success` if successful, a `Failure` if not.
(set-remove couch name value)
Remove a string from the named set.
true
if successful, false
if not.Remove a string from the named set. - Returns `true` if successful, `false` if not.
(set-remove* couch name value)
Attempt to remove a string from the named set.
true
wrapped in a Success
if successful, a Failure
if not.Attempt to remove a string from the named set. - Returns `true` wrapped in a `Success` if successful, a `Failure` if not.
(store couch namespace key value cas)
Store a Clojure value endoded in a document in the namespace.
create
, lookup
or store
operations. If the store failed because of CAS token mismatch, you should
obtain a new CAS token and the current existing value for the key by
calling lookup
.false
will be returned.nil
will be returned.Store a Clojure value endoded in a document in the namespace. - The namespace must already exist. - A document must already exist for the key. - To prevent concurrent updates, a check-and-set (CAS) token must be supplied which matches that of the existing token for the document. If the CAS tokens do not match, the store will fail. - CAS tokens can be obtained from previous `create`, `lookup` or `store` operations. If the store failed because of CAS token mismatch, you should obtain a new CAS token and the current existing value for the key by calling `lookup`. - If successful, the value passed in will be returned with an updated CAS token. - If the CAS token did not match, `false` will be returned. - If unable to find the document, `nil` will be returned.
(store* couch namespace key value cas)
Attempt to store a Clojure value endoded in a document in the namespace.
create
, lookup
or store
operations. If the store failed because of CAS token mismatch, you should
obtain a new CAS token and the current existing value for the key by
calling lookup
.Success
.Failure
will be returned.Attempt to store a Clojure value endoded in a document in the namespace. - The namespace must already exist. - A document must already exist for the key. - To prevent concurrent updates, a check-and-set (CAS) token must be supplied which matches that of the existing token for the document. If the CAS tokens do not match, the store will fail. - CAS tokens can be obtained from previous `create`, `lookup` or `store` operations. If the store failed because of CAS token mismatch, you should obtain a new CAS token and the current existing value for the key by calling `lookup`. - If successful, the value passed in will be returned with an updated CAS token wrapped in a `Success`. - If unable to find the document, a `Failure` will be returned.
(swap-in couch namespace key f)
Atomically swaps the Clojure value encoded in a document using the supplied function.
f
to the previous value. Note that f
may be called several times (in the case of concurrent conflicts) and
therefore should be free of side effects and be efficient to call.Atomically swaps the Clojure value encoded in a document using the supplied function. - If the document does not already exist, it will be created. - The new value encode in the document will be determined by the result of applying the supplied function `f` to the previous value. Note that `f` may be called several times (in the case of concurrent conflicts) and therefore should be free of side effects and be efficient to call. - Returns the final value if successful, `nil, if not.
(swap-in* couch namespace key f)
Atomically swaps the Clojure value encoded in a document using the supplied function.
f
to the previous value. Note that f
may be called several times (in the case of concurrent conflicts) and
therefore should be free of side effects and be efficient to call.Success
if successful, a Failure
if not.Atomically swaps the Clojure value encoded in a document using the supplied function. - If the document does not already exist, it will be created. - The new value encode in the document will be determined by the result of applying the supplied function `f` to the previous value. Note that `f` may be called several times (in the case of concurrent conflicts) and therefore should be free of side effects and be efficient to call. - Returns the final value wrapped in a `Success` if successful, a `Failure` if not.
(write kv namespace key value)
Stores the Clojure value encoded in a document to the namespace.
Internally this function may call swap-in
with constantly
, or stomp on the
current value (if there is one) through some other mechanism. It is preferable
to call swap-in
if it is available.
nil
if not.Stores the Clojure value encoded in a document to the namespace. Internally this function may call `swap-in` with `constantly`, or stomp on the current value (if there is one) through some other mechanism. It is preferable to call `swap-in` if it is available. - Returns the stored value if successful, `nil` if not.
(write* kv namespace key value)
Stores the Clojure value encoded in a document to the namespace.
Internally this function may call swap-in
with constantly
, or stomp on the
current value (if there is one) through some other mechanism. It is preferable
to call swap-in
if it is available.
Stores the Clojure value encoded in a document to the namespace. Internally this function may call `swap-in` with `constantly`, or stomp on the current value (if there is one) through some other mechanism. It is preferable to call `swap-in` if it is available. - If successful, returns the stored value wrapped in a Success. If unable to store the value, a Failure will be returned.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close