QueryCondition logical operations constants
const ( AND logicalOperation = iota OR ELEMENT_AND )
QueryCondition operations constants
const ( EXISTS conditionQueryOperation = iota NOT_EXISTS NOT_IN IN TYPE_OF NOT_TYPE_OF MATCHES NOT_MATCHES LIKE NOT_LIKE )
const ( END endType = iota )
const RFC3339FullDate = "2006-01-02"
var ErrorCode_name = map[int32]string{ 0: "NO_ERROR", 2: "TABLE_NOT_FOUND", 5: "IO_ERROR", 12: "OUT_OF_MEMORY", 13: "ACCESS_DENIED", 17: "TABLE_ALREADY_EXISTS", 22: "INVALID_ARGUMENT", 38: "UNSUPPORTED_OPERATION", 256: "UNKNOWN_ERROR", 260: "UNKNOWN_PAYLOAD_ENCODING", 270: "CLUSTER_NOT_FOUND", 271: "PATH_NOT_FOUND", 280: "DOCUMENT_ALREADY_EXISTS", 281: "DOCUMENT_NOT_FOUND", 290: "ENCODING_ERROR", 291: "DECODING_ERROR", 292: "ILLEGAL_MUTATION", }
var ErrorCode_value = map[string]int32{ "NO_ERROR": 0, "TABLE_NOT_FOUND": 2, "IO_ERROR": 5, "OUT_OF_MEMORY": 12, "ACCESS_DENIED": 13, "TABLE_ALREADY_EXISTS": 17, "INVALID_ARGUMENT": 22, "UNSUPPORTED_OPERATION": 38, "UNKNOWN_ERROR": 256, "UNKNOWN_PAYLOAD_ENCODING": 260, "CLUSTER_NOT_FOUND": 270, "PATH_NOT_FOUND": 271, "DOCUMENT_ALREADY_EXISTS": 280, "DOCUMENT_NOT_FOUND": 281, "ENCODING_ERROR": 290, "DECODING_ERROR": 291, "ILLEGAL_MUTATION": 292, }
var FindResponseType_name = map[int32]string{ 0: "UNKNOWN_TYPE", 1: "RESULT_DOCUMENT", 2: "QUERY_PLAN", }
var FindResponseType_value = map[string]int32{ "UNKNOWN_TYPE": 0, "RESULT_DOCUMENT": 1, "QUERY_PLAN": 2, }
var InsertMode_name = map[int32]string{ 0: "UNKNOWN_MODE", 1: "INSERT_OR_REPLACE", 2: "INSERT", 3: "REPLACE", }
var InsertMode_value = map[string]int32{ "UNKNOWN_MODE": 0, "INSERT_OR_REPLACE": 1, "INSERT": 2, "REPLACE": 3, }
var PayloadEncoding_name = map[int32]string{ 0: "UNKNOWN_ENCODING", 1: "JSON_ENCODING", }
var PayloadEncoding_value = map[string]int32{ "UNKNOWN_ENCODING": 0, "JSON_ENCODING": 1, }
func RegisterMapRDbServerServer(s *grpc.Server, srv MapRDbServerServer)
func StreamClientAuthInterceptor(umd *userMetadata) grpc.StreamClientInterceptor
func StreamClientTokenInterceptor(umd *userMetadata) grpc.StreamClientInterceptor
func UnaryClientAuthInterceptor(umd *userMetadata) grpc.UnaryClientInterceptor
Closure function which returns custom UnaryClientInterceptor for channel
func UnaryClientTokenInterceptor(umd *userMetadata) grpc.UnaryClientInterceptor
UnaryClientTokenInterceptor responsible for unauthenticated response code in Unary calls.
structure that is used in gRPC requests instead of string or []byte _id representation
type BinaryOrStringId struct { IsBinary bool Binary []byte Str string }
func BosiFromBinary(binary []byte) *BinaryOrStringId
Creates BinaryOrStringId struct from []byte
func BosiFromString(str string) *BinaryOrStringId
Creates BinaryOrStringId struct from string
QueryCondition comparison operation type
type Comparison int
QueryCondition comparison operations constants
const ( LESS Comparison = iota LESS_OR_EQUAL GREATER GREATER_OR_EQUAL EQUAL NOT_EQUAL )
Condition structure with required fields
type Condition struct {
// contains filtered or unexported fields
}
func MakeCondition(conditions ...ConditionOptions) (*Condition, error)
MakeCondition returns new empty Condition
func (condition *Condition) AsMap() map[string]interface{}
Returns condition as Map
func (condition *Condition) Build() (*Condition, error)
Builds Query Condition
func (condition *Condition) IsBuilt() bool
IsBuilt checks is Condition built
func (condition *Condition) IsEmpty() bool
IsEmpty checks Condition and returns boolean result
type ConditionOptions func(condition *Condition) (*Condition, error)
func AddCondition(conditionToAdd *Condition) ConditionOptions
Adds existing condition into new Query Condition
func AddConditionMap(conditionToAdd map[string]interface{}) ConditionOptions
Adds existing condition into new Query Condition
func And() ConditionOptions
And adds the logical operator 'and' in query condition
func Close() ConditionOptions
Close adds the 'end' operation in condition queue. Close required after each logical operation as 'or', 'and' or 'elementAnd' and all query condition must ends on Close
func ElementAnd(fieldPath string) ConditionOptions
ElementAnd adds the logical operator 'elementAnd' in query condition
func Equals(fieldPath string, value interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath equals the specified value. Two values are considered equal if and only if they contain the same key-value pair in the same order.
func Exists(fieldPath string) ConditionOptions
Adds a condition that tests for existence of the specified.
func In(fieldPath string, valueList []interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath is equal to at least one of the values in the specified list.
func Is(fieldPath string, op Comparison, value interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath satisfies the given Op against the specified value.
func Like(fieldPath string, likeExpr interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath is a string and matches the specified SQL LIKE expression optionally escaped with the specified escape character.
func Matches(fieldPath string, regex interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath is a string and matches the specified regular expression.
func NotEquals(fieldPath string, value interface{}) ConditionOptions
Adds a condition that tests if the Value at the specified fieldPath does not equal the specified value. Two values are considered equal if and only if they contain the same key-value pair in the same order.
func NotExists(fieldPath string) ConditionOptions
Adds a condition that tests for non-existence of the specified fieldPath.
func NotIn(fieldPath string, valueList []interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath is not equal to any of the values in the
func NotLike(fieldPath string, likeExpr interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath is a string and does not match the specified SQL LIKE expression optionally escaped with the specified escape character.
func NotMatches(fieldPath string, regex interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath is a string and does not match the specified regular expression.
func NotTypeOf(fieldPath string, valueType interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath is not of the specified valueType.
func Or() ConditionOptions
Or adds the logical operator 'or' in query condition
func TypeOf(fieldPath string, valueType interface{}) ConditionOptions
Adds a condition that tests if the value at the specified fieldPath is of the specified valueType.
type Connection struct {
// contains filtered or unexported fields
}
func MakeConnection(connectionString string) (*Connection, error)
Function initialize connection and returns new Connection struct
func MakeConnectionWithRetryOptions( connectionString string, connectionOptions *ConnectionOptions, ) (*Connection, error)
Function initialize connection with specific retry options and returns new Connection struct
func (connection *Connection) Close()
Method Close closes gRPC channel.
func (connection *Connection) CreateDocumentFromMap(documentMap map[string]interface{}) *Document
Creates and returns a new instance of an OJAI Document.
func (connection *Connection) CreateDocumentFromString(jsonString string) (*Document, error)
Creates and returns a new instance of an OJAI Document.
func (connection *Connection) CreateEmptyDocument() (*Document, error)
Creates and returns a new, empty instance of an OJAI Document.
func (connection *Connection) CreateStore(storeName string) (*DocumentStore, error)
Method executes CreateTable RPC request with given store name and return new DocumentStore.
func (connection *Connection) DeleteStore(storeName string) error
Method executes DeleteTable RPC request with given store name.
func (connection *Connection) GetStore(storeName string) (*DocumentStore, error)
Method executes IsStoreExists method for ensure that store with given name is exists and return new DocumentStore if result is positive.
func (connection *Connection) IsStoreExists(storeName string) (bool, error)
Method executes TableExists RPC request with given store name and return true if table is exists or false if not.
ConnectionOptions apply to all calls for the connections MaxAttempt attempt count WaitBetweenSeconds delay between attempts in seconds CallTimeoutSeconds maximum call timeout
type ConnectionOptions struct { MaxAttempt int WaitBetweenSeconds int CallTimeoutSeconds int }
type CreateTableRequest struct { TablePath string `protobuf:"bytes,1,opt,name=table_path,json=tablePath,proto3" json:"table_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CreateTableRequest) Descriptor() ([]byte, []int)
func (m *CreateTableRequest) GetTablePath() string
func (*CreateTableRequest) ProtoMessage()
func (m *CreateTableRequest) Reset()
func (m *CreateTableRequest) String() string
func (m *CreateTableRequest) XXX_DiscardUnknown()
func (m *CreateTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *CreateTableRequest) XXX_Merge(src proto.Message)
func (m *CreateTableRequest) XXX_Size() int
func (m *CreateTableRequest) XXX_Unmarshal(b []byte) error
type CreateTableResponse struct { //* // `NO_ERROR` - if the table was created successfully, // `TABLE_ALREADY_EXISTS` - if a table with the same path already exists Error *RpcError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CreateTableResponse) Descriptor() ([]byte, []int)
func (m *CreateTableResponse) GetError() *RpcError
func (*CreateTableResponse) ProtoMessage()
func (m *CreateTableResponse) Reset()
func (m *CreateTableResponse) String() string
func (m *CreateTableResponse) XXX_DiscardUnknown()
func (m *CreateTableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *CreateTableResponse) XXX_Merge(src proto.Message)
func (m *CreateTableResponse) XXX_Size() int
func (m *CreateTableResponse) XXX_Unmarshal(b []byte) error
type DeleteRequest struct { TablePath string `protobuf:"bytes,1,opt,name=table_path,json=tablePath,proto3" json:"table_path,omitempty"` PayloadEncoding PayloadEncoding `protobuf:"varint,2,opt,name=payload_encoding,json=payloadEncoding,proto3,enum=com.mapr.data.db.PayloadEncoding" json:"payload_encoding,omitempty"` // Types that are valid to be assigned to Condition: // *DeleteRequest_JsonCondition Condition isDeleteRequest_Condition `protobuf_oneof:"condition"` // Types that are valid to be assigned to Document: // *DeleteRequest_JsonDocument Document isDeleteRequest_Document `protobuf_oneof:"document"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DeleteRequest) Descriptor() ([]byte, []int)
func (m *DeleteRequest) GetCondition() isDeleteRequest_Condition
func (m *DeleteRequest) GetDocument() isDeleteRequest_Document
func (m *DeleteRequest) GetJsonCondition() string
func (m *DeleteRequest) GetJsonDocument() string
func (m *DeleteRequest) GetPayloadEncoding() PayloadEncoding
func (m *DeleteRequest) GetTablePath() string
func (*DeleteRequest) ProtoMessage()
func (m *DeleteRequest) Reset()
func (m *DeleteRequest) String() string
func (m *DeleteRequest) XXX_DiscardUnknown()
func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *DeleteRequest) XXX_Merge(src proto.Message)
func (*DeleteRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (m *DeleteRequest) XXX_Size() int
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error
type DeleteRequest_JsonCondition struct { JsonCondition string `protobuf:"bytes,3,opt,name=json_condition,json=jsonCondition,proto3,oneof"` }
type DeleteRequest_JsonDocument struct { JsonDocument string `protobuf:"bytes,4,opt,name=json_document,json=jsonDocument,proto3,oneof"` }
type DeleteResponse struct { //* // `NO_ERROR` - if a document was deleted successfully Error *RpcError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DeleteResponse) Descriptor() ([]byte, []int)
func (m *DeleteResponse) GetError() *RpcError
func (*DeleteResponse) ProtoMessage()
func (m *DeleteResponse) Reset()
func (m *DeleteResponse) String() string
func (m *DeleteResponse) XXX_DiscardUnknown()
func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *DeleteResponse) XXX_Merge(src proto.Message)
func (m *DeleteResponse) XXX_Size() int
func (m *DeleteResponse) XXX_Unmarshal(b []byte) error
type DeleteTableRequest struct { TablePath string `protobuf:"bytes,1,opt,name=table_path,json=tablePath,proto3" json:"table_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DeleteTableRequest) Descriptor() ([]byte, []int)
func (m *DeleteTableRequest) GetTablePath() string
func (*DeleteTableRequest) ProtoMessage()
func (m *DeleteTableRequest) Reset()
func (m *DeleteTableRequest) String() string
func (m *DeleteTableRequest) XXX_DiscardUnknown()
func (m *DeleteTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *DeleteTableRequest) XXX_Merge(src proto.Message)
func (m *DeleteTableRequest) XXX_Size() int
func (m *DeleteTableRequest) XXX_Unmarshal(b []byte) error
type DeleteTableResponse struct { //* // `NO_ERROR` - if the table exists // `TABLE_NOT_FOUND` - if the table does not exist Error *RpcError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DeleteTableResponse) Descriptor() ([]byte, []int)
func (m *DeleteTableResponse) GetError() *RpcError
func (*DeleteTableResponse) ProtoMessage()
func (m *DeleteTableResponse) Reset()
func (m *DeleteTableResponse) String() string
func (m *DeleteTableResponse) XXX_DiscardUnknown()
func (m *DeleteTableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *DeleteTableResponse) XXX_Merge(src proto.Message)
func (m *DeleteTableResponse) XXX_Size() int
func (m *DeleteTableResponse) XXX_Unmarshal(b []byte) error
type Document struct {
// contains filtered or unexported fields
}
func MakeDocument(operations ...DocumentOperations) (*Document, error)
MakeDocument function creates and returns new Document
func MakeDocumentFromJson(jsonDocument string) (*Document, error)
MakeDocumentFromJson function creates and returns new Document from given JSON string
func MakeDocumentFromMap(initialData map[string]interface{}) *Document
MakeDocumentFromMap function creates and returns new Document from given map[string]interface{}
func (doc *Document) AsJsonString() string
Method returns document content as JSON string
func (doc *Document) AsMap() map[string]interface{}
Method returns document content as map[string]interface{}
func (doc *Document) AsString() string
Method returns document content as string
func (doc *Document) Clean() *Document
Method cleans whole document
func (doc *Document) Delete(fieldPath string) *Document
The Delete function deletes element from given fieldPath if it exists in document.
func (doc *Document) GetBool(fieldPath string) (bool, error)
Method returns boolean value from given path or boolean zero value.
func (doc *Document) GetByte(fieldPath string) ([]byte, error)
Method returns []byte value from given path or []byte zero value.
func (doc *Document) GetDate(fieldPath string) (ODate, error)
Method returns types.ODate object from given path otherwise nil
func (doc *Document) GetFloat32(fieldPath string) (float32, error)
Method returns float value from given path or float zero value.
func (doc *Document) GetFloat64(fieldPath string) (float64, error)
Method returns float value from given path or string float value.
func (doc *Document) GetIdBinary() ([]byte, error)
Method returns _id of document or []byte zero value if it doesn't exists.
func (doc *Document) GetIdString() (string, error)
Method returns _id of document or string zero value if it doesn't exists.
func (doc *Document) GetInt(fieldPath string) (int, error)
Method returns int value from given path or int zero value.
func (doc *Document) GetMap(fieldPath string) (map[string]interface{}, error)
Method returns map[string]interface{} value from given path otherwise nil
func (doc *Document) GetSlice(fieldPath string) ([]interface{}, error)
Method returns []interface{} value from given path otherwise nil
func (doc *Document) GetString(fieldPath string) (string, error)
Method returns string value from given path or string zero value.
func (doc *Document) GetTime(fieldPath string) (OTime, error)
Method returns types.Otime object from given path otherwise nil
func (doc *Document) GetTimestamp(fieldPath string) (OTimestamp, error)
Method returns types.OTimestamp object from given path otherwise OTimestamp zero value
func (doc *Document) HasId() bool
Method check is _id key exists in the document map and returns true or false accordingly
func (doc *Document) IsNil(fieldPath string) (bool, error)
Method returns true if value for given path is nil or path doesn't exists.
func (doc *Document) IsPathExists(fieldPath string) bool
Method checks is path exists in the Document.
func (doc *Document) MarshalJSON() ([]byte, error)
Implementation of Marshaler interface for JSON encoding.
func (doc *Document) SetBool(fieldPath string, value bool) *Document
SetBool method sets bool value to given field path
func (doc *Document) SetByte(fieldPath string, value []byte) *Document
SetByte method sets []byte value to given field path
func (doc *Document) SetDate(fieldPath string, value *ODate) *Document
SetDate method sets ODate value to given field path
func (doc *Document) SetFloat32(fieldPath string, value float32) *Document
SetFloat32 method sets float32 value to given field path
func (doc *Document) SetFloat64(fieldPath string, value float64) *Document
SetFloat64 method sets float64 value to given field path
func (doc *Document) SetIdBinary(id []byte) error
SetIdBinary method sets not empty _id byte field in the Document
func (doc *Document) SetIdString(id string) error
SetIdString method sets not empty _id string field in the Document
func (doc *Document) SetInt(fieldPath string, value int) *Document
SetInt method sets int value to given field path
func (doc *Document) SetMap(fieldPath string, value map[string]interface{}) *Document
SetMap method sets map[string]interface{} value to given field path
func (doc *Document) SetNil(fieldPath string) *Document
SetNil method sets nil value to given field path
func (doc *Document) SetSlice(fieldPath string, value []interface{}) *Document
SetSlice method sets list[]interface{}value to given field path
func (doc *Document) SetString(fieldPath string, value string) *Document
SetString method sets string value to given field path
func (doc *Document) SetTime(fieldPath string, value *OTime) *Document
SetTime method sets OTIme value to given field path
func (doc *Document) SetTimestamp(fieldPath string, value *OTimestamp) *Document
SetTimestamp method sets OTimestamp value to given field path
func (doc *Document) UnmarshalJSON(b []byte) error
Unmarshaler interface implementation
DocumentMutation struct
type DocumentMutation struct {
// contains filtered or unexported fields
}
func MakeDocumentMutation(mutations ...MutationOperations) (*DocumentMutation, error)
MakeDocumentationMutation function process and returns new DocumentMutation and error
Type for Document functional options
type DocumentOperations func(document *Document) (*Document, error)
func SetBool(fieldPath string, value bool) DocumentOperations
SetBool method sets bool value to given field path
func SetByte(fieldPath string, value []byte) DocumentOperations
SetByte method sets []byte value to given field path
func SetDate(fieldPath string, value *ODate) DocumentOperations
SetDate method sets ODate value to given field path
func SetFloat32(fieldPath string, value float32) DocumentOperations
SetFloat32 method sets float32 value to given field path
func SetFloat64(fieldPath string, value float64) DocumentOperations
SetFloat64 method sets float64 value to given field path
func SetIdBinary(id []byte) DocumentOperations
SetIdBinary functional option which sets not empty _id byte field in theDocument
func SetIdString(id string) DocumentOperations
SetIdString functional option which sets not empty _id string field in the Document
func SetInt(fieldPath string, value int) DocumentOperations
SetInt method sets int value to given field path
func SetMap(fieldPath string, value map[string]interface{}) DocumentOperations
SetMap method sets map[string]interface{} value to given field path
func SetNil(fieldPath string) DocumentOperations
SetNil method sets nil value to given field path
func SetSlice(fieldPath string, value []interface{}) DocumentOperations
SetSlice method sets list[]interface{}value to given field path
func SetString(fieldPath string, value string) DocumentOperations
SetString method sets string value to given field path
func SetTime(fieldPath string, value *OTime) DocumentOperations
SetTime method sets OTIme value to given field path
func SetTimestamp(fieldPath string, value *OTimestamp) DocumentOperations
SetTimestamp method sets OTimestamp value to given field path
type DocumentStore struct {
// contains filtered or unexported fields
}
func (documentStore *DocumentStore) CheckAndDelete(id *BinaryOrStringId, condition *MapOrStructCondition) error
CheckAndDelete method atomically evaluates the condition on given document and if the condition holds true for the document then it is atomically deleted. id string or []byte document _id. condition the condition to evaluate on the document.
func (documentStore *DocumentStore) CheckAndDeleteWithContext( id *BinaryOrStringId, condition *MapOrStructCondition, ctx context.Context, ) error
CheckAndDeleteWithContext method atomically evaluates the condition on given document and if the condition holds true for the document then it is atomically deleted. User defined context is required for this method. id string or []byte document _id. condition the condition to evaluate on the document.
func (documentStore *DocumentStore) CheckAndReplace( condition *MapOrStructCondition, document *Document, ) error
Atomically evaluates the condition on the given document and if the condition holds true for the document then it atomically replaces the document with the given document. condition the condition to evaluate on the document. document document to replace
func (documentStore *DocumentStore) CheckAndReplaceWithContext( condition *MapOrStructCondition, document *Document, ctx context.Context, ) error
CheckAndReplaceWithContext method atomically evaluates the condition on the given document and if the condition holds true for the document then it atomically replaces the document with the given document. User defined context is required for this method. condition the condition to evaluate on the document. document document to replace
func (documentStore *DocumentStore) CheckAndReplaceWithId( id *BinaryOrStringId, condition *MapOrStructCondition, document *Document, ) error
Atomically evaluates the condition on the given document and if the condition holds true for the document then it atomically replaces the document with the given document. id document id. condition the condition to evaluate on the document. document document to replace
func (documentStore *DocumentStore) CheckAndReplaceWithIdContext( id *BinaryOrStringId, condition *MapOrStructCondition, document *Document, ctx context.Context, ) error
CheckAndReplaceWithIdContext method atomically evaluates the condition on the given document and if the condition holds true for the document then it atomically replaces the document with the given document. User defined context is required for this method. id document id. condition the condition to evaluate on the document. document document to replace
func (documentStore *DocumentStore) CheckAndUpdate( id *BinaryOrStringId, queryCondition *MapOrStructCondition, documentMutation *MapOrStructMutation, ) (bool, error)
CheckAndUpdate method atomically evaluates the condition on a given document and if the condition holds true for the document then a mutation is applied on the document.
func (documentStore *DocumentStore) CheckAndUpdateWithContext( id *BinaryOrStringId, queryCondition *MapOrStructCondition, documentMutation *MapOrStructMutation, ctx context.Context, ) (bool, error)
CheckAndUpdateWithContext method atomically evaluates the condition on a given document and if the condition holds true for the document then a mutation is applied on the document.
func (documentStore *DocumentStore) DecrementFloat64(id *BinaryOrStringId, fieldPath string, dec float64) error
DecrementFloat64 method atomically applies an decrement to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the decremental value. The operation will fail if the decrement is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation dec decrement to apply to a field.
func (documentStore *DocumentStore) DecrementFloat64ByOne(id *BinaryOrStringId, fieldPath string) error
DecrementFloat64ByOne method atomically applies an decrement by one to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the decremental value. The operation will fail if the decrement is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation
func (documentStore *DocumentStore) DecrementFloat64ByOneWithContext( id *BinaryOrStringId, fieldPath string, ctx context.Context, ) error
DecrementFloat64ByOneWithContext method atomically applies an decrement by one to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the decremental value. The operation will fail if the decrement is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation
func (documentStore *DocumentStore) DecrementFloat64WithContext( id *BinaryOrStringId, fieldPath string, dec float64, ctx context.Context, ) error
DecrementFloat64WithContext method atomically applies an decrement to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the decremental value. The operation will fail if the decrement is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation dec decrement to apply to a field.
func (documentStore *DocumentStore) DecrementInt(id *BinaryOrStringId, fieldPath string, dec int) error
DecrementInt method atomically applies an decrement to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the decremental value. The operation will fail if the decrement is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation dec decrement to apply to a field.
func (documentStore *DocumentStore) DecrementIntByOne(id *BinaryOrStringId, fieldPath string) error
DecrementIntByOne method atomically applies an decrement by one to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the decremental value. The operation will fail if the decrement is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation
func (documentStore *DocumentStore) DecrementIntByOneWithContext( id *BinaryOrStringId, fieldPath string, ctx context.Context, ) error
DecrementIntByOneWithContext method atomically applies an decrement by one to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the decremental value. The operation will fail if the decrement is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation
func (documentStore *DocumentStore) DecrementIntWithContext( id *BinaryOrStringId, fieldPath string, dec int, ctx context.Context, ) error
DecrementIntWithContext method atomically applies an decrement to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the decremental value. The operation will fail if the decrement is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation dec decrement to apply to a field.
func (documentStore *DocumentStore) DeleteByIdBinary(id []byte) (bool, error)
DeleteByIdBinary method takes []byte _id, create new Document and executes gRPC Delete request on server and returns true if the Document was deleted from MapR-DB table otherwise false.
func (documentStore *DocumentStore) DeleteByIdBinaryWithContext(id []byte, ctx context.Context) (bool, error)
DeleteByIdBinaryWithContext method takes []byte _id, create new Document and executes gRPC Delete request on server and returns true if the Document was deleted from MapR-DB table otherwise false. User defined context is required for this method.
func (documentStore *DocumentStore) DeleteByIdString(id string) (bool, error)
DeleteByIdString method takes string _id, create new Document and executes gRPC Delete request on server and returns true if the Document was deleted from MapR-DB table otherwise false.
func (documentStore *DocumentStore) DeleteByIdStringWithContext(id string, ctx context.Context) (bool, error)
DeleteByIdStringWithContext method takes string _id, create new Document and executes gRPC Delete request on server and returns true if the Document was deleted from MapR-DB table otherwise false. User defined context is required for this method.
func (documentStore *DocumentStore) DeleteDoc(doc *Document) (bool, error)
DeleteDoc method takes Document and executes gRPC Delete request on server and returns true if the Document was deleted from MapR-DB table otherwise false.
func (documentStore *DocumentStore) DeleteDocWithContext(doc *Document, ctx context.Context) (bool, error)
DeleteDocWithContext method takes Document and executes gRPC Delete request on server and returns true if the Document was deleted from MapR-DB table otherwise false. User defined context is required for this method.
func (documentStore *DocumentStore) FindAll(findOptions *FindOptions) (*QueryResult, error)
FindAll method executes gRPC Find request and returns all content of specific DocumentStore findOptions is FindOptions struct with specific query parameters returns QueryResult with response content and error
func (documentStore *DocumentStore) FindAllWithContext( findOptions *FindOptions, ctx context.Context, ) (*QueryResult, error)
FindAllWithContext method executes gRPC Find request and returns all content of specific DocumentStore User defined context is required for this method. findOptions is FindOptions struct with specific query parameters returns QueryResult with response content and error
func (documentStore *DocumentStore) FindByIdByte(id []byte) (*Document, error)
FindByIdByte method executes gRPC FindById request with id field as array of byte on server and returns Document if it exists in MapR-DB
func (documentStore *DocumentStore) FindByIdByteWithContext(id []byte, ctx context.Context) (*Document, error)
FindByIdByteWithContext method executes gRPC FindById request with id field as array of byte on server and returns Document if it exists in MapR-DB User defined context is required for this method.
func (documentStore *DocumentStore) FindByIdByteWithFieldsAndCondition( id []byte, fieldPaths []string, queryCondition *MapOrStructCondition, ) (*Document, error)
FindByIdByteWithFieldsAndCondition method returns the document with the specified `_id` or nil if the document with that `_id` either doesn't exist in this DocumentStore or does not meet the specified condition. id Document id. field_paths list of fields that should be returned in the read document. condition query condition to test the document
func (documentStore *DocumentStore) FindByIdByteWithFieldsAndConditionContext( id []byte, fieldPaths []string, queryCondition *MapOrStructCondition, ctx context.Context, ) (*Document, error)
FindByIdByteWithFieldsAndConditionContext method returns the document with the specified `_id` or nil if the document with that `_id` either doesn't exist in this DocumentStore or does not meet the specified condition. User defined context is required for this method. id Document id. field_paths list of fields that should be returned in the read document. condition query condition to test the document
func (documentStore *DocumentStore) FindByIdString(id string) (*Document, error)
FindByIdString method executes gRPC FindById request with id field as string on server and returns Document if it exists in MapR-DB
func (documentStore *DocumentStore) FindByIdStringWithContext(id string, ctx context.Context) (*Document, error)
FindByIdStringWithContext method executes gRPC FindById request with id field as string on server and returns Document if it exists in MapR-DB User defined context is required for this method.
func (documentStore *DocumentStore) FindByIdStringWithFieldsAndCondition( id string, fieldPaths []string, queryCondition *MapOrStructCondition, ) (*Document, error)
FindByIdStringWithFieldsAndCondition method returns the document with the specified `_id` or nil if the document with that `_id` either doesn't exist in this DocumentStore or does not meet the specified condition. id Document id. field_paths list of fields that should be returned in the read document. condition query condition to test the document
func (documentStore *DocumentStore) FindByIdStringWithFieldsAndConditionContext( id string, fieldPaths []string, queryCondition *MapOrStructCondition, ctx context.Context, ) (*Document, error)
FindByIdStringWithFieldsAndConditionContext method returns the document with the specified `_id` or nil if the document with that `_id` either doesn't exist in this DocumentStore or does not meet the specified condition. User defined context is required for this method. id Document id. field_paths list of fields that should be returned in the read document. condition query condition to test the document
func (documentStore *DocumentStore) FindQuery(query *Query, findOptions *FindOptions) (*QueryResult, error)
FindQuery method executes gRPC Find request and returns QueryResult and error. query is Query struct with OJAI query content findOptions is FindOptions struct with specific query parameters
func (documentStore *DocumentStore) FindQueryMap( query map[string]interface{}, findOptions *FindOptions, ) (*QueryResult, error)
FindQueryMap method executes gRPC Find request and returns QueryResult and error. query is map[string]interface{} with OJAI query content findOptions is FindOptions struct with specific query parameters
func (documentStore *DocumentStore) FindQueryMapWithContext( query map[string]interface{}, findOptions *FindOptions, ctx context.Context, ) (*QueryResult, error)
FindQueryMapWithContext method executes gRPC Find request and returns QueryResult and error. User defined context is required for this method. query is map[string]interface{} with OJAI query content findOptions is FindOptions struct with specific query parameters
func (documentStore *DocumentStore) FindQueryString(query string, findOptions *FindOptions) (*QueryResult, error)
FindQueryString executes gRPC Find request and returns QueryResult and error. query is json string representation of OJAI query content findOptions is FindOptions struct with specific query parameters
func (documentStore *DocumentStore) FindQueryStringWithContext( query string, findOptions *FindOptions, ctx context.Context, ) (*QueryResult, error)
FindQueryString executes gRPC Find request and returns QueryResult and error. User defined context is required for this method. query is json string representation of OJAI query content findOptions is FindOptions struct with specific query parameters
func (documentStore *DocumentStore) FindQueryWithContext( query *Query, findOptions *FindOptions, ctx context.Context, ) (*QueryResult, error)
FindQueryWithContext method executes gRPC Find request and returns QueryResult and error. User defined context is required for this method. query is Query struct with OJAI query content findOptions is FindOptions struct with specific query parameters
func (documentStore *DocumentStore) IncrementFloat64(id *BinaryOrStringId, fieldPath string, inc float64) error
IncrementFloat64 method atomically applies an increment to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the incremental value. The operation will fail if the increment is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation inc increment to apply to a field.
func (documentStore *DocumentStore) IncrementFloat64ByOne(id *BinaryOrStringId, fieldPath string) error
IncrementFloat64ByOne method atomically applies an increment by one to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the incremental value. The operation will fail if the increment is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation inc increment to apply to a field.
func (documentStore *DocumentStore) IncrementFloat64ByOneWithContext( id *BinaryOrStringId, fieldPath string, ctx context.Context, ) error
IncrementFloat64ByOneWithContext method atomically applies an increment by one to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the incremental value. The operation will fail if the increment is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation inc increment to apply to a field.
func (documentStore *DocumentStore) IncrementFloat64WithContext( id *BinaryOrStringId, fieldPath string, inc float64, ctx context.Context, ) error
IncrementFloat64WithContext method atomically applies an increment to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the incremental value. The operation will fail if the increment is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation inc increment to apply to a field.
func (documentStore *DocumentStore) IncrementInt(id *BinaryOrStringId, fieldPath string, inc int) error
IncrementInt method atomically applies an increment to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the incremental value. The operation will fail if the increment is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation inc increment to apply to a field.
func (documentStore *DocumentStore) IncrementIntByOne(id *BinaryOrStringId, fieldPath string) error
IncrementIntByOne method atomically applies an increment by one to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the incremental value. The operation will fail if the increment is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation
func (documentStore *DocumentStore) IncrementIntByOneWithContext( id *BinaryOrStringId, fieldPath string, ctx context.Context, ) error
IncrementIntByOneWithContext method atomically applies an increment by one to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the incremental value. The operation will fail if the increment is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation
func (documentStore *DocumentStore) IncrementIntWithContext( id *BinaryOrStringId, fieldPath string, inc int, ctx context.Context, ) error
IncrementIntWithContext method atomically applies an increment to a given field (in dot separated notation) of the given document id. If the field doesn't exist on the server then it will be created with the type of the incremental value. The operation will fail if the increment is applied to a field that is of a non-numeric type. _id string or byte document id fieldPath the field name in dot separated notation inc increment to apply to a field.
func (documentStore *DocumentStore) InsertDocument(doc *Document) error
InsertDocument method inserts Document into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertDocumentWithContext(doc *Document, ctx context.Context) error
InsertDocumentWithContext method inserts Document into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertDocumentWithIdBinary(doc *Document, id []byte) error
InsertDocumentWithIdBinary method changes the Document id if exists or add new id field and inserts the Document into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertDocumentWithIdBinaryContext( doc *Document, id []byte, ctx context.Context, ) error
InsertDocumentWithIdBinaryContext method changes the Document id if exists or add new id field and inserts the Document into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertDocumentWithIdString(doc *Document, id string) error
InsertDocumentWithIdString method changes the Document id if exists or add new id field and inserts the Document into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertDocumentWithIdStringContext( doc *Document, id string, ctx context.Context, ) error
InsertDocumentWithIdStringContext method changes the Document id if exists or add new id field and inserts the Document into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertMap(docMap map[string]interface{}) error
InsertMap method inserts map[string]interface{} into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertMapWithContext(docMap map[string]interface{}, ctx context.Context) error
InsertMapWithContext method inserts map[string]interface{} into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertMapWithIdBinary(docMap map[string]interface{}, id []byte) error
InsertMapWithIdBinary method changes id if exists or add new if field and inserts map[string]interface{} into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertMapWithIdBinaryContext( docMap map[string]interface{}, id []byte, ctx context.Context, ) error
InsertMapWithIdBinaryContext method changes id if exists or add new if field and inserts map[string]interface{} into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertMapWithIdString(docMap map[string]interface{}, id string) error
InsertMapWithIdString method changes id if exists or add new if field and inserts map[string]interface{} into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertMapWithIdStringContext( docMap map[string]interface{}, id string, ctx context.Context, ) error
InsertMapWithIdStringContext method changes id if exists or add new if field and inserts map[string]interface{} into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertOrReplaceDocument(doc *Document) error
InsertOrReplaceDocument method inserts or replaces the Document into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceDocumentWithContext(doc *Document, ctx context.Context) error
InsertOrReplaceDocumentWithContext method inserts or replaces the Document into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertOrReplaceDocumentWithIdBinary(doc *Document, id []byte) error
InsertOrReplaceDocumentWithIdBinary method changes the Document id if exists or add new id field and inserts or replaces Document into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceDocumentWithIdBinaryContext( doc *Document, id []byte, ctx context.Context) error
InsertOrReplaceDocumentWithIdBinaryContext method changes the Document id if exists or add new id field and inserts or replaces Document into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertOrReplaceDocumentWithIdString(doc *Document, id string) error
InsertOrReplaceDocumentWithIdString method changes the Document id if exists or add new id field and inserts or replaces Document into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceDocumentWithIdStringContext( doc *Document, id string, ctx context.Context, ) error
InsertOrReplaceDocumentWithIdStringContext method changes the Document id if exists or add new id field and inserts or replaces Document into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertOrReplaceMap(docMap map[string]interface{}) error
InsertOrReplaceMap method inserts or replaces map[string]interface{} into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceMapWithContext( docMap map[string]interface{}, ctx context.Context, ) error
InsertOrReplaceMapWithContext method inserts or replaces map[string]interface{} into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertOrReplaceMapWithIdBinary(docMap map[string]interface{}, id []byte) error
InsertOrReplaceMapWithIdString method changes id if exists or add new if field and inserts or replaces map[string]interface{} into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceMapWithIdBinaryContext( docMap map[string]interface{}, id []byte, ctx context.Context, ) error
InsertOrReplaceMapWithIdBinaryContext method changes id if exists or add new if field and inserts or replaces map[string]interface{} into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertOrReplaceMapWithIdString(docMap map[string]interface{}, id string) error
InsertOrReplaceMapWithIdString method changes id if exists or add new if field and inserts or replaces map[string]interface{} into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceMapWithIdStringContext( docMap map[string]interface{}, id string, ctx context.Context, ) error
InsertOrReplaceMapWithIdStringContext method changes id if exists or add new if field and inserts or replaces map[string]interface{} into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertOrReplaceString(docString string) error
InsertOrReplaceString method inserts or replaces string into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceStringWithContext(docString string, ctx context.Context) error
InsertOrReplaceStringWithContext method inserts or replaces string into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertOrReplaceStringWithIdBinary(docString string, id []byte) error
InsertOrReplaceStringWithIdBinary method changes id if exists or add new id field and inserts or replaces string into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceStringWithIdBinaryContext( docString string, id []byte, ctx context.Context, ) error
InsertOrReplaceStringWithIdBinaryContext method changes id if exists or add new id field and inserts or replaces string into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertOrReplaceStringWithIdString(docString string, id string) error
InsertOrReplaceStringWithIdString method changes id if exists or and new id field and inserts or replaces string into the store in MapR-DB.
func (documentStore *DocumentStore) InsertOrReplaceStringWithIdStringContext( docString string, id string, ctx context.Context, ) error
InsertOrReplaceStringWithIdStringContext method changes id if exists or and new id field and inserts or replaces string into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) InsertString(docString string) error
InsertString method inserts string into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertStringWithContext(docString string, ctx context.Context) error
InsertString method inserts string into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertStringWithIdBinary(docString string, id []byte) error
InsertStringWithIdBinary method changes if if exists or add new id field and inserts string into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertStringWithIdBinaryContext( docString string, id []byte, ctx context.Context, ) error
InsertStringWithIdBinaryContext method changes if if exists or add new id field and inserts string into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertStringWithIdString(docString string, id string) error
InsertStringWithIdString method changes id if exists or add new id field and inserts string into the store in MapR-DB. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) InsertStringWithIdStringContext( docString string, id string, ctx context.Context, ) error
InsertStringWithIdStringContext method changes id if exists or add new id field and inserts string into the store in MapR-DB. User defined context is required for this method. This operation is successful only when the document with the given id doesn't exist. If "_id" already existed in the document, then an error will be thrown.
func (documentStore *DocumentStore) ReplaceDocument(doc *Document) error
ReplaceDocument method replaces the Document into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceDocumentWithContext(doc *Document, ctx context.Context) error
ReplaceDocumentWithContext method replaces the Document into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) ReplaceDocumentWithIdBinary(doc *Document, id []byte) error
ReplaceDocumentWithIdBinary method changes the Document id if exists or add new if field and replaces the Document into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceDocumentWithIdBinaryContext( doc *Document, id []byte, ctx context.Context, ) error
ReplaceDocumentWithIdBinaryContext method changes the Document id if exists or add new if field and replaces the Document into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) ReplaceDocumentWithIdString(doc *Document, id string) error
ReplaceDocumentWithIdString method changes the Document id if exists or add new if field and replaces the Document into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceDocumentWithIdStringContext( doc *Document, id string, ctx context.Context, ) error
ReplaceDocumentWithIdStringContext method changes the Document id if exists or add new if field and replaces the Document into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) ReplaceMap(docMap map[string]interface{}) error
ReplaceMap method replaces map[string]interface{} into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceMapWithContext(docMap map[string]interface{}, ctx context.Context) error
ReplaceMapWithContext method replaces map[string]interface{} into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) ReplaceMapWithIdBinary(docMap map[string]interface{}, id []byte) error
ReplaceMapWithIdBinary method changes id id exists or add new id field and replaces map[string]interface{} into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceMapWithIdBinaryContext( docMap map[string]interface{}, id []byte, ctx context.Context, ) error
ReplaceMapWithIdBinaryContext method changes id id exists or add new id field and replaces map[string]interface{} into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) ReplaceMapWithIdString(docMap map[string]interface{}, id string) error
ReplaceMapWithIdString method changes id id exists or add new id field and replaces map[string]interface{} into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceMapWithIdStringContext( docMap map[string]interface{}, id string, ctx context.Context, ) error
ReplaceMapWithIdStringContext method changes id id exists or add new id field and replaces map[string]interface{} into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) ReplaceString(docString string) error
ReplaceString method replaces string into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceStringWithContext( docString string, ctx context.Context, ) error
ReplaceStringWithContext method replaces string into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) ReplaceStringWithIdBinary(docString string, id []byte) error
ReplaceStringWithIdBinary method changes id if exists or add new id field and replaces string into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceStringWithIdBinaryContext( docString string, id []byte, ctx context.Context, ) error
ReplaceStringWithIdBinaryContext method changes id if exists or add new id field and replaces string into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) ReplaceStringWithIdString(docString string, id string) error
ReplaceStringWithIdString method changes id if exists or add new id field and replaces string into the store in MapR-DB.
func (documentStore *DocumentStore) ReplaceStringWithIdStringContext( docString string, id string, ctx context.Context, ) error
ReplaceStringWithIdStringContext method changes id if exists or add new id field and replaces string into the store in MapR-DB. User defined context is required for this method.
func (documentStore *DocumentStore) Update( id *BinaryOrStringId, documentMutation *MapOrStructMutation, ) error
Update method applies a mutation on the document identified by the document id. All updates specified by the mutation object should be applied atomically, and consistently meaning either all of the updates in mutation are applied or none of them is applied and a partial update should not be visible to an observer.
func (documentStore *DocumentStore) UpdateWithContext( id *BinaryOrStringId, documentMutation *MapOrStructMutation, ctx context.Context, ) error
UpdateWithContext method applies a mutation on the document identified by the document id. All updates specified by the mutation object should be applied atomically, and consistently meaning either all of the updates in mutation are applied or none of them is applied and a partial update should not be visible to an observer.
type DocumentStream struct {
// contains filtered or unexported fields
}
* RPC response error codes. POSIX error codes are used where appropriate.
Extended error codes, those that can not be mapped to a POSIX error code, begins at 256.
type ErrorCode int32
const ( //* // No error, operation completed successfully. ErrorCode_NO_ERROR ErrorCode = 0 //* // Specified table does not exist ErrorCode_TABLE_NOT_FOUND ErrorCode = 2 //* // An I/O error occurred on the server(s) ErrorCode_IO_ERROR ErrorCode = 5 //* // The operation resulted in server(s) running out of memory ErrorCode_OUT_OF_MEMORY ErrorCode = 12 //* // User does not have sufficient permission to execute the operation. ErrorCode_ACCESS_DENIED ErrorCode = 13 //* // The specified table already exists. ErrorCode_TABLE_ALREADY_EXISTS ErrorCode = 17 //* // One or more request parameter was invalid. // This error code should be used whenever a request parameter was unrecognized or outside a valid domain. // For example, an unrecognized enum value was supplied for InsertMode. ErrorCode_INVALID_ARGUMENT ErrorCode = 22 //* // Requested operation is not supported by this server. // This error code should be used if a known, valid operation is not supported by the current service. ErrorCode_UNSUPPORTED_OPERATION ErrorCode = 38 //* // Catch-all for all undefined errors on server. ErrorCode_UNKNOWN_ERROR ErrorCode = 256 // // Extended error codes. // // TODO: renumber the error codes before release // ErrorCode_UNKNOWN_PAYLOAD_ENCODING ErrorCode = 260 ErrorCode_CLUSTER_NOT_FOUND ErrorCode = 270 ErrorCode_PATH_NOT_FOUND ErrorCode = 271 ErrorCode_DOCUMENT_ALREADY_EXISTS ErrorCode = 280 ErrorCode_DOCUMENT_NOT_FOUND ErrorCode = 281 ErrorCode_ENCODING_ERROR ErrorCode = 290 ErrorCode_DECODING_ERROR ErrorCode = 291 ErrorCode_ILLEGAL_MUTATION ErrorCode = 292 )
func (ErrorCode) EnumDescriptor() ([]byte, []int)
func (x ErrorCode) String() string
type FindByIdRequest struct { TablePath string `protobuf:"bytes,1,opt,name=table_path,json=tablePath,proto3" json:"table_path,omitempty"` PayloadEncoding PayloadEncoding `protobuf:"varint,2,opt,name=payload_encoding,json=payloadEncoding,proto3,enum=com.mapr.data.db.PayloadEncoding" json:"payload_encoding,omitempty"` //* // <b>[Optional]</b><p/> // List of OJAI FieldPaths that should be included in the returned document Projections []string `protobuf:"bytes,3,rep,name=projections,proto3" json:"projections,omitempty"` // Types that are valid to be assigned to Condition: // *FindByIdRequest_JsonCondition Condition isFindByIdRequest_Condition `protobuf_oneof:"condition"` // Types that are valid to be assigned to Document: // *FindByIdRequest_JsonDocument Document isFindByIdRequest_Document `protobuf_oneof:"document"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FindByIdRequest) Descriptor() ([]byte, []int)
func (m *FindByIdRequest) GetCondition() isFindByIdRequest_Condition
func (m *FindByIdRequest) GetDocument() isFindByIdRequest_Document
func (m *FindByIdRequest) GetJsonCondition() string
func (m *FindByIdRequest) GetJsonDocument() string
func (m *FindByIdRequest) GetPayloadEncoding() PayloadEncoding
func (m *FindByIdRequest) GetProjections() []string
func (m *FindByIdRequest) GetTablePath() string
func (*FindByIdRequest) ProtoMessage()
func (m *FindByIdRequest) Reset()
func (m *FindByIdRequest) String() string
func (m *FindByIdRequest) XXX_DiscardUnknown()
func (m *FindByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *FindByIdRequest) XXX_Merge(src proto.Message)
func (*FindByIdRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (m *FindByIdRequest) XXX_Size() int
func (m *FindByIdRequest) XXX_Unmarshal(b []byte) error
type FindByIdRequest_JsonCondition struct { JsonCondition string `protobuf:"bytes,4,opt,name=json_condition,json=jsonCondition,proto3,oneof"` }
type FindByIdRequest_JsonDocument struct { JsonDocument string `protobuf:"bytes,5,opt,name=json_document,json=jsonDocument,proto3,oneof"` }
type FindByIdResponse struct { //* // `NO_ERROR` - if a document with the specified `_id` was found // `DOCUMENT_NOT_FOUND` - if the document with the specified `_id` does not exist Error *RpcError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` PayloadEncoding PayloadEncoding `protobuf:"varint,2,opt,name=payload_encoding,json=payloadEncoding,proto3,enum=com.mapr.data.db.PayloadEncoding" json:"payload_encoding,omitempty"` // Types that are valid to be assigned to Data: // *FindByIdResponse_JsonDocument Data isFindByIdResponse_Data `protobuf_oneof:"data"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FindByIdResponse) Descriptor() ([]byte, []int)
func (m *FindByIdResponse) GetData() isFindByIdResponse_Data
func (m *FindByIdResponse) GetError() *RpcError
func (m *FindByIdResponse) GetJsonDocument() string
func (m *FindByIdResponse) GetPayloadEncoding() PayloadEncoding
func (*FindByIdResponse) ProtoMessage()
func (m *FindByIdResponse) Reset()
func (m *FindByIdResponse) String() string
func (m *FindByIdResponse) XXX_DiscardUnknown()
func (m *FindByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *FindByIdResponse) XXX_Merge(src proto.Message)
func (*FindByIdResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (m *FindByIdResponse) XXX_Size() int
func (m *FindByIdResponse) XXX_Unmarshal(b []byte) error
type FindByIdResponse_JsonDocument struct { JsonDocument string `protobuf:"bytes,30,opt,name=json_document,json=jsonDocument,proto3,oneof"` }
type FindOptions struct { IncludeQueryPlan bool ResultAsDocument bool }
type FindRequest struct { TablePath string `protobuf:"bytes,1,opt,name=table_path,json=tablePath,proto3" json:"table_path,omitempty"` PayloadEncoding PayloadEncoding `protobuf:"varint,2,opt,name=payload_encoding,json=payloadEncoding,proto3,enum=com.mapr.data.db.PayloadEncoding" json:"payload_encoding,omitempty"` IncludeQueryPlan bool `protobuf:"varint,3,opt,name=include_query_plan,json=includeQueryPlan,proto3" json:"include_query_plan,omitempty"` // Types that are valid to be assigned to Data: // *FindRequest_JsonQuery Data isFindRequest_Data `protobuf_oneof:"data"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FindRequest) Descriptor() ([]byte, []int)
func (m *FindRequest) GetData() isFindRequest_Data
func (m *FindRequest) GetIncludeQueryPlan() bool
func (m *FindRequest) GetJsonQuery() string
func (m *FindRequest) GetPayloadEncoding() PayloadEncoding
func (m *FindRequest) GetTablePath() string
func (*FindRequest) ProtoMessage()
func (m *FindRequest) Reset()
func (m *FindRequest) String() string
func (m *FindRequest) XXX_DiscardUnknown()
func (m *FindRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *FindRequest) XXX_Merge(src proto.Message)
func (*FindRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (m *FindRequest) XXX_Size() int
func (m *FindRequest) XXX_Unmarshal(b []byte) error
type FindRequest_JsonQuery struct { JsonQuery string `protobuf:"bytes,4,opt,name=json_query,json=jsonQuery,proto3,oneof"` }
* Results of Find() RPCs are streamed to the clients, with each FindResponse containing one OJAI document. If the `include_query_plan` in FindRequest was set to true, the first FindResponse will contain the query plan instead of OJAI Document
type FindResponse struct { Error *RpcError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` PayloadEncoding PayloadEncoding `protobuf:"varint,2,opt,name=payload_encoding,json=payloadEncoding,proto3,enum=com.mapr.data.db.PayloadEncoding" json:"payload_encoding,omitempty"` //* // Indicates the type of this response Type FindResponseType `protobuf:"varint,3,opt,name=type,proto3,enum=com.mapr.data.db.FindResponseType" json:"type,omitempty"` // Types that are valid to be assigned to Data: // *FindResponse_JsonResponse Data isFindResponse_Data `protobuf_oneof:"data"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FindResponse) Descriptor() ([]byte, []int)
func (m *FindResponse) GetData() isFindResponse_Data
func (m *FindResponse) GetError() *RpcError
func (m *FindResponse) GetJsonResponse() string
func (m *FindResponse) GetPayloadEncoding() PayloadEncoding
func (m *FindResponse) GetType() FindResponseType
func (*FindResponse) ProtoMessage()
func (m *FindResponse) Reset()
func (m *FindResponse) String() string
func (m *FindResponse) XXX_DiscardUnknown()
func (m *FindResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *FindResponse) XXX_Merge(src proto.Message)
func (*FindResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (m *FindResponse) XXX_Size() int
func (m *FindResponse) XXX_Unmarshal(b []byte) error
type FindResponseType int32
const ( //* // Invalid, unknown type FindResponseType_UNKNOWN_TYPE FindResponseType = 0 //* // Indicates that the current response contains a QueryResult Document FindResponseType_RESULT_DOCUMENT FindResponseType = 1 //* // Indicates that the current response contains a Query plan FindResponseType_QUERY_PLAN FindResponseType = 2 )
func (FindResponseType) EnumDescriptor() ([]byte, []int)
func (x FindResponseType) String() string
type FindResponse_JsonResponse struct { JsonResponse string `protobuf:"bytes,30,opt,name=json_response,json=jsonResponse,proto3,oneof"` }
type InsertMode int32
const ( //* // Invalid, unknown mode InsertMode_UNKNOWN_MODE InsertMode = 0 //* // Insert this document WHETHER OR NOT a document with the same _id exist in the store InsertMode_INSERT_OR_REPLACE InsertMode = 1 //* // Insert this document ONLY IF another document with the same _id DOES NOT exist in the store InsertMode_INSERT InsertMode = 2 //* // Insert this document ONLY IF a document with the same _id EXISTS in the store InsertMode_REPLACE InsertMode = 3 )
func (InsertMode) EnumDescriptor() ([]byte, []int)
func (x InsertMode) String() string
type InsertOrReplaceRequest struct { TablePath string `protobuf:"bytes,1,opt,name=table_path,json=tablePath,proto3" json:"table_path,omitempty"` InsertMode InsertMode `protobuf:"varint,2,opt,name=insert_mode,json=insertMode,proto3,enum=com.mapr.data.db.InsertMode" json:"insert_mode,omitempty"` PayloadEncoding PayloadEncoding `protobuf:"varint,3,opt,name=payload_encoding,json=payloadEncoding,proto3,enum=com.mapr.data.db.PayloadEncoding" json:"payload_encoding,omitempty"` // Types that are valid to be assigned to Condition: // *InsertOrReplaceRequest_JsonCondition Condition isInsertOrReplaceRequest_Condition `protobuf_oneof:"condition"` // Types that are valid to be assigned to Data: // *InsertOrReplaceRequest_JsonDocument Data isInsertOrReplaceRequest_Data `protobuf_oneof:"data"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*InsertOrReplaceRequest) Descriptor() ([]byte, []int)
func (m *InsertOrReplaceRequest) GetCondition() isInsertOrReplaceRequest_Condition
func (m *InsertOrReplaceRequest) GetData() isInsertOrReplaceRequest_Data
func (m *InsertOrReplaceRequest) GetInsertMode() InsertMode
func (m *InsertOrReplaceRequest) GetJsonCondition() string
func (m *InsertOrReplaceRequest) GetJsonDocument() string
func (m *InsertOrReplaceRequest) GetPayloadEncoding() PayloadEncoding
func (m *InsertOrReplaceRequest) GetTablePath() string
func (*InsertOrReplaceRequest) ProtoMessage()
func (m *InsertOrReplaceRequest) Reset()
func (m *InsertOrReplaceRequest) String() string
func (m *InsertOrReplaceRequest) XXX_DiscardUnknown()
func (m *InsertOrReplaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *InsertOrReplaceRequest) XXX_Merge(src proto.Message)
func (*InsertOrReplaceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (m *InsertOrReplaceRequest) XXX_Size() int
func (m *InsertOrReplaceRequest) XXX_Unmarshal(b []byte) error
type InsertOrReplaceRequest_JsonCondition struct { JsonCondition string `protobuf:"bytes,4,opt,name=json_condition,json=jsonCondition,proto3,oneof"` }
type InsertOrReplaceRequest_JsonDocument struct { JsonDocument string `protobuf:"bytes,30,opt,name=json_document,json=jsonDocument,proto3,oneof"` }
type InsertOrReplaceResponse struct { Error *RpcError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*InsertOrReplaceResponse) Descriptor() ([]byte, []int)
func (m *InsertOrReplaceResponse) GetError() *RpcError
func (*InsertOrReplaceResponse) ProtoMessage()
func (m *InsertOrReplaceResponse) Reset()
func (m *InsertOrReplaceResponse) String() string
func (m *InsertOrReplaceResponse) XXX_DiscardUnknown()
func (m *InsertOrReplaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *InsertOrReplaceResponse) XXX_Merge(src proto.Message)
func (m *InsertOrReplaceResponse) XXX_Size() int
func (m *InsertOrReplaceResponse) XXX_Unmarshal(b []byte) error
structure that is used in gRPC requests instead of Map or Condition representation
type MapOrStructCondition struct { MapCondition map[string]interface{} StructCondition *Condition // contains filtered or unexported fields }
func MoscFromMap(condition map[string]interface{}) *MapOrStructCondition
Creates BapOrStructCondition struct from map[string]interface{}
func MoscFromStruct(condition *Condition) *MapOrStructCondition
Creates BapOrStructCondition struct from Condition
structure that is used in gRPC requests instead of Map or DocumentMutation representation
type MapOrStructMutation struct { IsMap bool MapMutation map[string]interface{} StructMutation *DocumentMutation }
func MosmFromMap(mutation map[string]interface{}) *MapOrStructMutation
func MosmFromStruct(mutation *DocumentMutation) *MapOrStructMutation
MapRDbServerClient is the client API for MapRDbServer service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MapRDbServerClient interface { // Ping RPC Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) // Admin RPCs CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*CreateTableResponse, error) DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*DeleteTableResponse, error) TableExists(ctx context.Context, in *TableExistsRequest, opts ...grpc.CallOption) (*TableExistsResponse, error) // CRUD RPCs InsertOrReplace(ctx context.Context, in *InsertOrReplaceRequest, opts ...grpc.CallOption) (*InsertOrReplaceResponse, error) FindById(ctx context.Context, in *FindByIdRequest, opts ...grpc.CallOption) (*FindByIdResponse, error) Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (MapRDbServer_FindClient, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) }
func NewMapRDbServerClient(cc *grpc.ClientConn) MapRDbServerClient
MapRDbServerServer is the server API for MapRDbServer service.
type MapRDbServerServer interface { // Ping RPC Ping(context.Context, *PingRequest) (*PingResponse, error) // Admin RPCs CreateTable(context.Context, *CreateTableRequest) (*CreateTableResponse, error) DeleteTable(context.Context, *DeleteTableRequest) (*DeleteTableResponse, error) TableExists(context.Context, *TableExistsRequest) (*TableExistsResponse, error) // CRUD RPCs InsertOrReplace(context.Context, *InsertOrReplaceRequest) (*InsertOrReplaceResponse, error) FindById(context.Context, *FindByIdRequest) (*FindByIdResponse, error) Find(*FindRequest, MapRDbServer_FindServer) error Update(context.Context, *UpdateRequest) (*UpdateResponse, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) }
type MapRDbServer_FindClient interface { Recv() (*FindResponse, error) grpc.ClientStream }
type MapRDbServer_FindServer interface { Send(*FindResponse) error grpc.ServerStream }
type MutationOp int
const ( None MutationOp = iota SET SET_OR_REPLACE DELETE APPEND INCREMENT DECREMENT MERGE )
Type for DocumentMutation functional options
type MutationOperations func(documentMutation *DocumentMutation) (*DocumentMutation, error)
func AppendSlice(fieldPath string, value []interface{}) MutationOperations
Appends the given value to an existing value at the given path
func AppendString(fieldPath, value string) MutationOperations
Appends the given value to an existing value at the given path
func DecrementFloat64(fieldPath string, value float64) MutationOperations
Atomically decrement the existing value at given the fieldPath by the given value.
func DecrementFloat64ByOne(fieldPath string) MutationOperations
Atomically decrement the existing value at given the fieldPath by the given value.
func DecrementInt(fieldPath string, value int) MutationOperations
Atomically decrement the existing value at given the fieldPath by the given value.
func DecrementIntByOne(fieldPath string) MutationOperations
Atomically decrement the existing value at given the fieldPath by the given value.
func Delete(fieldPath string) MutationOperations
func IncrementFloat64(fieldPath string, value float64) MutationOperations
Atomically increment the existing value at given the fieldPath by the given value.
func IncrementFloat64ByOne(fieldPath string) MutationOperations
Atomically increment the existing value at given the fieldPath by the given value.
func IncrementInt(fieldPath string, value int) MutationOperations
Atomically increment the existing value at given the fieldPath by the given value.
func IncrementIntByOne(fieldPath string) MutationOperations
Atomically increment the existing value at given the fieldPath by the given value.
func MergeDocument(fieldPath string, value *Document) MutationOperations
Merges the existing MAP at the given fieldPath.
func MergeMap(fieldPath string, value map[string]interface{}) MutationOperations
Merges the existing MAP at the given fieldPath.
func Set(fieldPath string, value interface{}) MutationOperations
Sets the field at the given fieldPath to given value fieldPath: path of the field that needs to be updated. the new value to set at the path.
func SetOrReplace(fieldPath string, value interface{}) MutationOperations
Sets or replaces the field at the given fieldPath to value fieldPath in the document that needs to be updated. value: the new value to set or replace at the given path.
OJAI Date day representation
type ODate struct {
// contains filtered or unexported fields
}
func MakeODate(year, month, dayOfMonth int) *ODate
MakeDate creates and returns ODate from year, month and day of month.
func MakeODateFromDate(date *time.Time) *ODate
MakeODateFromDate creates and returns ODate from time.Time.
func MakeODateFromString(date string) (*ODate, error)
MakeODateFromString creates and returns date from string in RFC3339FullDate format. example : "2015-11-11"
func MakeODateFromTimestampInt(timestamp int64) *ODate
MakeODateFromTimestampInt creates and returns date from Unix timestamp in int64 format
func MakeODateFromTimestampString(timestamp string) *ODate
MakeODateFromTimestampString creates and returns date from Unix timestamp in string format
func (date *ODate) GetDate() time.Time
GetDate returns time.Time of the ODate
func (date *ODate) GetDay() int
GetDay returns day of the ODate
func (date *ODate) GetMonth() int
GetMonth returns month of the ODate
func (date *ODate) GetYear() int
GetYear returns year of the ODate
func (date *ODate) MarshalJSON() ([]byte, error)
Marshaller implementation for ODate
func (date *ODate) String() string
Stringer interface implementation
OJAI time representation
type OTime struct {
// contains filtered or unexported fields
}
func MakeOTime(hourOfDay, minutes, seconds int) *OTime
func MakeOTimeFromDate(date *time.Time) *OTime
func MakeOTimeFromString(date string) (*OTime, error)
Make OTime from string and layout format
func MakeOTimeFromStringRFC3339(date string) (*OTime, error)
Make OTime from string in RFC3339 format. example : "2015-11-11T10:30:24.354Z"
func MakeOTimeFromTimestampInt(timestamp int64) *OTime
Make OTime from Unix timestamp in int64 format
func MakeOTimeFromTimestampString(timestamp string) (*OTime, error)
Make OTime from Unix timestamp in string format
func MakeOTimeWithNsec(hourOfDay, minutes, seconds, nsec int) *OTime
func (time *OTime) GetHour() int
GetHour returns time hour of the OTime
func (time *OTime) GetMinute() int
GetMinute returns time minute of the OTime
func (time *OTime) GetNanosecond() int
GetNanosecond returns nanosecond of the OTime
func (time *OTime) GetSecond() int
GetSecond returns second of the OTime
func (time *OTime) GetTime() *time.Time
GetTime returns time.Time of the OTime
func (time *OTime) GetTimeString() string
GetTimeString returns time as string
func (time *OTime) MarshalJSON() ([]byte, error)
Marshaller implementation for OTime
func (time *OTime) String() string
Stringer interface implementation
type OTimestamp struct {
// contains filtered or unexported fields
}
func MakeOTimestamp(years, months, days, hours, minutes, seconds, millis int) *OTimestamp
Make OTimestamp from years, months, days, hours, minutes, seconds and millis
func MakeOTimestampFromDate(date time.Time) *OTimestamp
Make OTimestamp from time.Time
func MakeOTimestampFromString(str string) *OTimestamp
Make OTimestamp from RFC3339 string representation
func MakeOTimestampFromUnixTimestamp(sec, nsec int) *OTimestamp
Make OTimestamp from Unix timestamp
func (timestamp *OTimestamp) DateTime() time.Time
Returns time.Time of OTimestamp
func (timestamp *OTimestamp) Days() int
Returns Days from OTimestamp
func (timestamp *OTimestamp) Hours() int
Returns Hours from OTimestamp
func (timestamp *OTimestamp) MarshalJSON() ([]byte, error)
Marshaller implementation for OTimestamp
func (timestamp *OTimestamp) Millis() int
Returns Millis from OTimestamp
func (timestamp *OTimestamp) Minutes() int
Returns Minutes from OTimestamp
func (timestamp *OTimestamp) Months() int
Returns Months from OTimestamp
func (timestamp *OTimestamp) String() string
Stringer interface implementation
func (timestamp *OTimestamp) Years() int
Returns Years from OTimestamp
Query operation type
type Operation int
Query operations constants
const ( SELECT Operation = iota WHERE ORDER_BY OFFSET LIMIT )
type Order int
Constants which indicate order of response
const ( ASC Order = iota DESC )
* ENUM indicating the encoding scheme of the OJAI objects in RPC request/response. Currently only JSON encoding is supported.
type PayloadEncoding int32
const ( //* // Invalid, unknown encoding PayloadEncoding_UNKNOWN_ENCODING PayloadEncoding = 0 //* // Payload is encoded as JSON string PayloadEncoding_JSON_ENCODING PayloadEncoding = 1 )
func (PayloadEncoding) EnumDescriptor() ([]byte, []int)
func (x PayloadEncoding) String() string
type PingRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PingRequest) Descriptor() ([]byte, []int)
func (*PingRequest) ProtoMessage()
func (m *PingRequest) Reset()
func (m *PingRequest) String() string
func (m *PingRequest) XXX_DiscardUnknown()
func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *PingRequest) XXX_Merge(src proto.Message)
func (m *PingRequest) XXX_Size() int
func (m *PingRequest) XXX_Unmarshal(b []byte) error
type PingResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PingResponse) Descriptor() ([]byte, []int)
func (*PingResponse) ProtoMessage()
func (m *PingResponse) Reset()
func (m *PingResponse) String() string
func (m *PingResponse) XXX_DiscardUnknown()
func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *PingResponse) XXX_Merge(src proto.Message)
func (m *PingResponse) XXX_Size() int
func (m *PingResponse) XXX_Unmarshal(b []byte) error
Query structure which lets users build an OJAI Query that can be executed on an OJAI DocumentStore.
type Query struct {
// contains filtered or unexported fields
}
func MakeQuery(operations ...QueryOptions) (*Query, error)
MakeQuery creates empty Query struct
func (query *Query) AsMap() map[string]interface{}
Returns query's map
func (query *Query) Build()
Build builds the Query.
func (query *Query) CleanLimit() *Query
CleanLimit removes limit from query content if it exists
func (query *Query) CleanOffset() *Query
CleanOffset removes offset from query content if it exists
func (query *Query) CleanOrderBy() *Query
CleanSelect removes orderBy from query content if it exists
func (query *Query) CleanQuery() *Query
CleanQuery cleans entire query content
func (query *Query) CleanSelect() *Query
CleanSelect removes select argument from query content if it exists
func (query *Query) IsBuild() bool
IsBuild checks is query built and ready to send
type QueryOptions func(query *Query) (*Query, error)
func Limit(limit int) QueryOptions
Limit restricts the maximum number of documents returned from this query to the specified value. Negative values are not permitted.
func Offset(offset int) QueryOptions
Offset adds index which specifies number of Documents to skip before returning any result. Negative values are not permitted. Multiple invocation will overwrite the previous value.
func OrderBy(order Order, fieldPaths ...interface{}) QueryOptions
OrderBy sets the sort ordering of the returned Documents to the order of specified field path.
func Select(fields ...interface{}) QueryOptions
Select adds the list of field paths to the list of projected fields. If not specified, the entire Document will be returned.
func WhereCondition(where *Condition) QueryOptions
WhereCondition sets the filtering condition for the query.
func WhereMap(where map[string]interface{}) QueryOptions
WhereMap sets the filtering condition for the query.
Result of Find RPC request
type QueryResult struct {
// contains filtered or unexported fields
}
func MakeQueryResult(responseStream MapRDbServer_FindClient, findOptions *FindOptions) (*QueryResult, error)
MakeQueryResult creates and returns new QueryResult for each Find gRPC request responseStream gRPC response stream from server findOptions options which were passed in Find request
func (queryResult *QueryResult) DocumentList() []interface{}
DocumentList method returns slice of document which can be represent as map[string]interface{} or Document instances
func (queryResult *QueryResult) QueryPlan() string
QueryPlan method returns the query plan if the corresponding option was set in QueryOptions
* Protobuf message that encapsulates RPC operation error, if any. Each RPC response should include RpcError message, with `NO_ERROR` indicating success
type RpcError struct { //* // Error code for the RPC. `NO_ERROR` indicates RPC completed successfully ErrCode ErrorCode `protobuf:"varint,1,opt,name=err_code,json=errCode,proto3,enum=com.mapr.data.db.ErrorCode" json:"err_code,omitempty"` //* // NULL if `err` is `NO_ERROR` ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` //* // NULL if `err` is `NO_ERROR` JavaStackTrace string `protobuf:"bytes,3,opt,name=java_stack_trace,json=javaStackTrace,proto3" json:"java_stack_trace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RpcError) Descriptor() ([]byte, []int)
func (m *RpcError) GetErrCode() ErrorCode
func (m *RpcError) GetErrorMessage() string
func (m *RpcError) GetJavaStackTrace() string
func (*RpcError) ProtoMessage()
func (m *RpcError) Reset()
func (m *RpcError) String() string
func (m *RpcError) XXX_DiscardUnknown()
func (m *RpcError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *RpcError) XXX_Merge(src proto.Message)
func (m *RpcError) XXX_Size() int
func (m *RpcError) XXX_Unmarshal(b []byte) error
type TableExistsRequest struct { TablePath string `protobuf:"bytes,1,opt,name=table_path,json=tablePath,proto3" json:"table_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TableExistsRequest) Descriptor() ([]byte, []int)
func (m *TableExistsRequest) GetTablePath() string
func (*TableExistsRequest) ProtoMessage()
func (m *TableExistsRequest) Reset()
func (m *TableExistsRequest) String() string
func (m *TableExistsRequest) XXX_DiscardUnknown()
func (m *TableExistsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *TableExistsRequest) XXX_Merge(src proto.Message)
func (m *TableExistsRequest) XXX_Size() int
func (m *TableExistsRequest) XXX_Unmarshal(b []byte) error
type TableExistsResponse struct { //* // `NO_ERROR` - if the table exists // `TABLE_NOT_FOUND` - if the table does not exist Error *RpcError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TableExistsResponse) Descriptor() ([]byte, []int)
func (m *TableExistsResponse) GetError() *RpcError
func (*TableExistsResponse) ProtoMessage()
func (m *TableExistsResponse) Reset()
func (m *TableExistsResponse) String() string
func (m *TableExistsResponse) XXX_DiscardUnknown()
func (m *TableExistsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *TableExistsResponse) XXX_Merge(src proto.Message)
func (m *TableExistsResponse) XXX_Size() int
func (m *TableExistsResponse) XXX_Unmarshal(b []byte) error
type UpdateRequest struct { TablePath string `protobuf:"bytes,1,opt,name=table_path,json=tablePath,proto3" json:"table_path,omitempty"` PayloadEncoding PayloadEncoding `protobuf:"varint,2,opt,name=payload_encoding,json=payloadEncoding,proto3,enum=com.mapr.data.db.PayloadEncoding" json:"payload_encoding,omitempty"` // Types that are valid to be assigned to Document: // *UpdateRequest_JsonDocument Document isUpdateRequest_Document `protobuf_oneof:"document"` // Types that are valid to be assigned to Condition: // *UpdateRequest_JsonCondition Condition isUpdateRequest_Condition `protobuf_oneof:"condition"` // Types that are valid to be assigned to Mutation: // *UpdateRequest_JsonMutation Mutation isUpdateRequest_Mutation `protobuf_oneof:"mutation"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UpdateRequest) Descriptor() ([]byte, []int)
func (m *UpdateRequest) GetCondition() isUpdateRequest_Condition
func (m *UpdateRequest) GetDocument() isUpdateRequest_Document
func (m *UpdateRequest) GetJsonCondition() string
func (m *UpdateRequest) GetJsonDocument() string
func (m *UpdateRequest) GetJsonMutation() string
func (m *UpdateRequest) GetMutation() isUpdateRequest_Mutation
func (m *UpdateRequest) GetPayloadEncoding() PayloadEncoding
func (m *UpdateRequest) GetTablePath() string
func (*UpdateRequest) ProtoMessage()
func (m *UpdateRequest) Reset()
func (m *UpdateRequest) String() string
func (m *UpdateRequest) XXX_DiscardUnknown()
func (m *UpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *UpdateRequest) XXX_Merge(src proto.Message)
func (*UpdateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (m *UpdateRequest) XXX_Size() int
func (m *UpdateRequest) XXX_Unmarshal(b []byte) error
type UpdateRequest_JsonCondition struct { JsonCondition string `protobuf:"bytes,4,opt,name=json_condition,json=jsonCondition,proto3,oneof"` }
type UpdateRequest_JsonDocument struct { JsonDocument string `protobuf:"bytes,3,opt,name=json_document,json=jsonDocument,proto3,oneof"` }
type UpdateRequest_JsonMutation struct { JsonMutation string `protobuf:"bytes,30,opt,name=json_mutation,json=jsonMutation,proto3,oneof"` }
type UpdateResponse struct { //* // `NO_ERROR` - if a document was updated successfully // `DOCUMENT_NOT_FOUND` - if a document with specified `_id` does not exist or the specified condition // evaluated to 'false'. Error *RpcError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UpdateResponse) Descriptor() ([]byte, []int)
func (m *UpdateResponse) GetError() *RpcError
func (*UpdateResponse) ProtoMessage()
func (m *UpdateResponse) Reset()
func (m *UpdateResponse) String() string
func (m *UpdateResponse) XXX_DiscardUnknown()
func (m *UpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (m *UpdateResponse) XXX_Merge(src proto.Message)
func (m *UpdateResponse) XXX_Size() int
func (m *UpdateResponse) XXX_Unmarshal(b []byte) error