HyperDex provide Go bindings to the client under the import path github.com/rescrv/HyperDex/bindings/go/client. This library wraps the C client library and enables the use of native Go data types and uses Go’s native support for concurrency to exploit the asynchronous features of HyperDex.
All client operation are defined in the client package. You can access this in your program with:
import ("github.com/rescrv/HyperDex/bindings/go/client")
In your go environment, run this to fetch the module into your GOPATH.
go get github.com/rescrv/HyperDex/bindings/go/client
The following is a minimal application that stores the value ”Hello World” and then immediately retrieves the value:
package main import "fmt" import "github.com/rescrv/HyperDex/bindings/go/client" func main() { c, e, errChan := client.NewClient("127.0.0.1", 1982) // permanent error connecting from the cluster if e != nil { // handle the error here } // handle transient errors connecting to the cluster go func() { for e := range errChan { // handle the error here fmt.Println("error", e) } }() // do the operations err := c.Put("kv", "some key", client.Attributes{"v": "Hello World!"}) if err.Status != client.SUCCESS { // handle the error here } fmt.Println("put: \"Hello World!\"") obj, err := c.Get("kv", "some key") if err.Status != client.SUCCESS { // handle the error here } fmt.Println("got:", obj) }
You can run this example with:
% go run hello-world.go put: "Hello World!" got: map[v:Hello World!]
In Go, every HyperDex operation appears to the application as a synchronous call. Operations will appear to block the calling go-routine and suspend execution until the operation completes. Behind the scenes, the client will use the concurrency features of Go to allow many concurrent operations using the same client library. Additionally, Go types are automatically converted to HyperDex’s types under the hood.
The Go bindings automatically manage conversion of data types from Go to HyperDex types, enabling applications to be written in idiomatic Go.
This section shows examples of Go data structures that are recognized by HyperDex. The examples here are for illustration purposes and are not exhaustive. Strings The HyperDex client recognizes Go’s strings and automatically converts them to HyperDex strings. For example:
err := client.Put("kv", "some key", client.Attributes{"v": "some value"})Integers The HyperDex client recognizes Go’s integers and automatically converts them to HyperDex integers. For example:
err := client.Put("kv", "some key", client.Attributes{"v": 42}) err = client.Put("kv", "some key", client.Attributes{"v": int64(42)})Floats The HyperDex client recognizes Go’s floating point numbers and automatically converts them to HyperDex floats. For example:
err := client.Put("kv", "some key", client.Attributes{"v": 3.14})Lists The HyperDex client recognizes lists and automatically converts them to HyperDex lists. For example:
err := client.Put("kv", "some key", client.Attributes{"v": client.List{"A", "B", "C"}})Sets The HyperDex client recognizes sets and automatically converts them to HyperDex sets. For example:
err := client.Put("kv", "some key", client.Attributes{"v": client.Set{"A", "B", "C"}})Maps The HyperDex client recognizes Go dictionaries and automatically converts them to HyperDex maps. For example:
err := client.Put("kv", "some key", client.Attributes{"v": client.Map{"A": "X", "B": "Y", "C": "Z"}})
Attributes in Go are provided as struct client.Attributes, which has the same syntax as a Go map. As you can see in the examples above, attributes are specified in the form:
client.Attributes{"v1": "A", "v2": 3.14}
Map attributes in Go are provided as struct client.MapAttributes, which maps attribute names to client.Map objects that specify the key-value pairs to manipulate.
client.MapAttributes{"v": client.Map{"A": 3.14}}
Predicates in Go are specified as a slice of client.Predicate. Here’s a variety of Predicates provided by Go:
client.Predicate{"attr", "some value", client.EQUALS} client.Predicate{"attr", 5, client.LESS_THAN} client.Predicate{"attr", 5, client.LESS_EQUAL} client.Predicate{"attr", 5, client.GREATER_THAN} client.Predicate{"attr", 5, client.GREATER_EQUAL} client.Predicate{"attr", "^prefix", client.REGEX} client.Predicate{"attr", 42, client.LENGTH_EQUALS} client.Predicate{"attr", 42, client.LENGTH_LESS_EQUALS} client.Predicate{"attr", 42, client.LENGTH_GREATER_EQUALS} client.Predicate{"attr", "needle", client.CONTAINS}
All error handling within the Go bindings is done via client.Error returned from each operation. An error object will always be returned, and its status should be checked following the call. For example, we may conditionally change the value of v from “foo” to “bar” like this:
err := client.CondPut("kv", "some key", []client.Predicate{ {"v", "foo", client.EQUALS} }, client.Attributes{"v": "bar"}) if err.Status == client.SUCCESS { // it worked } else if err.Status == client.CMPFAIL { // the existing value was not "foo" } else if err.Status == client.NOTFOUND { // there is no existing value } else { // something more fatal happened // this is an exceptional case // propagate the error or try again }
Retrieve an object from space using key. Definition:
func (client *Client) Get(spacename string, key Value) (attrs Attributes, err *Error)Parameters:
Retrieve part of an object from space using key. Only the specified attributes of the object will be returned to the client. Definition:
func (client *Client) GetPartial(spacename string, key Value, attributenames AttributeNames) (attrs Attributes, err *Error)Parameters:
Store or update an object by key. The object’s attributes will be set to the values specified by attrs. If the object exists, it will be updated and all existing values not altered by attrs will be preserved. If the object does not exist, a new object will be created, with its attributes initialized to their default values. Definition:
func (client *Client) Put(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Conditionally update an the object stored under key in space. Existing values will be overwitten with the values specified by attrs. Values not specified by attrs will remain unchanged. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondPut(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Update all objects stored in space that match checks. Existing values will be overwitten with the values specified by attrs. Values not specified by attrs will remain unchanged.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupPut(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store or object under key in space if and only if the operation creates a new object. The object’s attributes will be set to the values specified by attrs; any attributes not specified by attrs will be initialized to their defaults. If the object exists, the operation will fail with CMPFAIL. Definition:
func (client *Client) PutIfNotExist(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Delete key from space. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) Del(spacename string, key Value) (err *Error)Parameters:
Conditionally delete the object stored under key from space. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondDel(spacename string, key Value, predicates []Predicate) (err *Error)Parameters:
Delete all objects that match the specified checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupDel(spacename string, predicates []Predicate) (count uint64, err *Error)Parameters:
Add the specified number to the existing value for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicAdd(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Add the specified number to the existing value for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicAdd(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Add the specified number to the existing value for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicAdd(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Subtract the specified number from the existing value for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicSub(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Subtract the specified number from the existing value for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicSub(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Subtract the specified number from the existing value for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicSub(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Multiply the existing value by the specified number for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicMul(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Multiply the existing value by the specified number for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicMul(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Multiply the existing value by the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicMul(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Divide the existing value by the specified number for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicDiv(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Divide the existing value by the specified number for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicDiv(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Divide the existing value by the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicDiv(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store the existing value modulo the specified number for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicMod(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Store the existing value modulo the specified number for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicMod(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Store the existing value modulo the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicMod(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store the bitwise AND of the existing value and the specified number for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicAnd(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Store the bitwise AND of the existing value and the specified number for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicAnd(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Store the bitwise AND of the existing value and the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicAnd(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store the bitwise OR of the existing value and the specified number for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicOr(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Store the bitwise OR of the existing value and the specified number for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicOr(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Store the bitwise OR of the existing value and the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicOr(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store the bitwise XOR of the existing value and the specified number for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicXor(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Store the bitwise XOR of the existing value and the specified number for each attribute if and only if checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicXor(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Store the bitwise XOR of the existing value and the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicXor(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store the minimum of the existing value and the provided value for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicMin(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Store the minimum of the existing value and the provided value for each attribute if and only if checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicMin(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Store the minimum of the existing value and the provided value for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicMin(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store the maximum of the existing value and the provided value for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) AtomicMax(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Store the maximum of the existing value and the provided value for each attribute if and only if checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondAtomicMax(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Store the maximum of the existing value and the provided value for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupAtomicMax(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Prepend the specified string to the existing value for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) StringPrepend(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Prepend the specified string to the existing value for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondStringPrepend(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Prepend the specified string to the existing value for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupStringPrepend(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Append the specified string to the existing value for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) StringAppend(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Append the specified string to the existing value for each attribute if and only if checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondStringAppend(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Append the specified string to the existing value for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupStringAppend(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Push the specified value onto the front of the list for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) ListLpush(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Push the specified value onto the front of the list for each attribute if and only if checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondListLpush(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Push the specified value onto the front of the list for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupListLpush(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Push the specified value onto the back of the list for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) ListRpush(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Push the specified value onto the back of the list for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondListRpush(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Push the specified value onto the back of the list for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupListRpush(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Add the specified value to the set for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) SetAdd(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Add the specified value to the set for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondSetAdd(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Add the specified value to the set for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupSetAdd(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Remove the specified value from the set. If the value is not contained within the set, this operation will do nothing. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) SetRemove(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Remove the specified value from the set if and only if the checks hold on the object. If the value is not contained within the set, this operation will do nothing. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondSetRemove(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Remove the specified value from the set for each object in space that matches checks. If the value is not contained within the set, this operation will do nothing.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupSetRemove(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store the intersection of the specified set and the existing value for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) SetIntersect(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Store the intersection of the specified set and the existing value for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondSetIntersect(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Store the intersection of the specified set and the existing value for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupSetIntersect(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Store the union of the specified set and the existing value for each attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) SetUnion(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Store the union of the specified set and the existing value for each attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondSetUnion(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Store the union of the specified set and the existing value for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupSetUnion(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Move a field within a document from one name to another. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) DocumentRename(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Move a field within a document from one name to another if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondDocumentRename(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Move a field within a document from one name to another for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupDocumentRename(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Remove a field or object from a document. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) DocumentUnset(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Remove a field or object from a document if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondDocumentUnset(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Remove a field or object from a document for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupDocumentUnset(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Insert a key-value pair into the map specified by each map-attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAdd(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Insert a key-value pair into the map specified by each map-attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAdd(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Insert a key-value pair into the map specified by each map-attribute for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAdd(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Remove a key-value pair from the map specified by each attribute. If there is no pair with the specified key within the map, this operation will do nothing. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapRemove(spacename string, key Value, attributes Attributes) (err *Error)Parameters:
Remove a key-value pair from the map specified by each attribute if and only if checks hold on the object. If there is no pair with the specified key within the map, this operation will do nothing. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapRemove(spacename string, key Value, predicates []Predicate, attributes Attributes) (err *Error)Parameters:
Remove a key-value pair from the map specified by each attribute for each object in space that matches checks. If there is no pair with the specified key within the map, this operation will do nothing.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapRemove(spacename string, predicates []Predicate, attributes Attributes) (count uint64, err *Error)Parameters:
Add the specified number to the value of a key-value pair within each map. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicAdd(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Add the specified number to the value of a key-value pair within each map if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicAdd(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Add the specified number to the value of a key-value pair within each map for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicAdd(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Subtract the specified number from the value of a key-value pair within each map. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicSub(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Subtract the specified number from the value of a key-value pair within each map if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicSub(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Subtract the specified number from the value of a key-value pair within each map for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicSub(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Multiply the value of each key-value pair by the specified number for each map. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicMul(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Multiply the value of each key-value pair by the specified number for each map attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicMul(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Multiply the value of each key-value pair by the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicMul(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Divide the value of each key-value pair by the specified number for each map. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicDiv(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Divide the value of each key-value pair by the specified number for each map if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicDiv(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Divide the value of each key-value pair by the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicDiv(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Store the value of the key-value pair modulo the specified number for each map. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicMod(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Store the value of the key-value pair modulo the specified number for each map attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicMod(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Store the value of the key-value pair modulo the specified number for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicMod(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Store the bitwise AND of the value of the key-value pair and the specified number for each map. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicAnd(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Store the bitwise AND of the value of the key-value pair and the specified number for each map attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicAnd(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Store the bitwise AND of the value of the key-value pair and the specified number for each map attribute for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicAnd(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Store the bitwise OR of the value of the key-value pair and the specified number for each map. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicOr(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Store the bitwise OR of the value of the key-value pair and the specified number for each map attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicOr(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Store the bitwise OR of the value of the key-value pair and the specified number for each map attribute for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicOr(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Store the bitwise XOR of the value of the key-value pair and the specified number for each map attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicXor(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Store the bitwise XOR of the value of the key-value pair and the specified number for each map attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicXor(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Store the bitwise XOR of the value of the key-value pair and the specified number for each map attribute for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicXor(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Prepend the specified string to the value of the key-value pair for each map. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapStringPrepend(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Prepend the specified string to the value of the key-value pair for each map attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapStringPrepend(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Prepend the specified string to the value of the key-value pair for each map attribute for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapStringPrepend(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Append the specified string to the value of the key-value pair for each map attribute. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapStringAppend(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Append the specified string to the value of the key-value pair for each map attribute if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapStringAppend(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Append the specified string to the value of the key-value pair for each map attribute for each object in space that matches checks
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapStringAppend(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Take the minium of the specified value and existing value for each key-value pair. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicMin(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Take the minium of the specified value and existing value for each key-value pair if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicMin(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Take the minium of the specified value and existing value for each key-value pair for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicMin(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Take the maximum of the specified value and existing value for each key-value pair. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND. Definition:
func (client *Client) MapAtomicMax(spacename string, key Value, mapattributes MapAttributes) (err *Error)Parameters:
Take the maximum of the specified value and existing value for each key-value pair if and only if the checks hold on the object. This operation requires a pre-existing object in order to complete successfully. If no object exists, the operation will fail with NOTFOUND.
This operation will succeed if and only if the predicates specified by checks hold on the pre-existing object. If any of the predicates are not true for the existing object, then the operation will have no effect and fail with CMPFAIL.
All checks are atomic with the write. HyperDex guarantees that no other operation will come between validating the checks, and writing the new version of the object.. Definition:
func (client *Client) CondMapAtomicMax(spacename string, key Value, predicates []Predicate, mapattributes MapAttributes) (err *Error)Parameters:
Take the maximum of the specified value and existing value for each key-value pair for each object in space that matches checks.
This operation will only affect objects that match the provided checks. Objects that do not match checks will be unaffected by the group call. Each object that matches checks will be atomically updated with the check on the object. HyperDex guarantees that no object will be altered if the checks do not pass at the time of the write. Objects that are updated concurrently with the group call may or may not be updated; however, regardless of any other concurrent operations, the preceding guarantee will always hold. Definition:
func (client *Client) GroupMapAtomicMax(spacename string, predicates []Predicate, mapattributes MapAttributes) (count uint64, err *Error)Parameters:
Return all objects that match the specified checks. This operation behaves as an iterator and may return multiple objects from the single call. Definition:
func (client *Client) Search(spacename string, predicates []Predicate) (attrs chan Attributes, errs chan Error)Parameters:
Return all objects that match the specified checks, sorted according to attr. This operation behaves as an iterator and may return multiple objects from the single call. Definition:
func (client *Client) SortedSearch(spacename string, predicates []Predicate, sortby string, limit uint32, maxmin string) (attrs chan Attributes, errs chan Error)Parameters:
Count the number of objects that match the specified checks. This will return the number of objects counted by the search. If an error occurs during the count, the count may reflect a partial count. The real count will be higher than the returned value.
A count is the server-side equivalent of performing a search, and counting the number of objects that exist. For that reason, its efficiency closely follows that of search, except it will not transfer any objects over the network. Definition:
func (client *Client) Count(spacename string, predicates []Predicate) (count uint64, err *Error)Parameters: