Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/christopherhesse/rethinkgo
/ functions
Functions
256 in github.com/christopherhesse/rethinkgo
⨍
Functions
256
◇
Types & classes
35
↓ 103 callers
Function
naryOperator
(kind expressionKind, operand interface{}, operands ...interface{})
query.go:119
↓ 45 callers
Function
Expr
Expr converts any value to an expression. Internally it uses the `json` module to convert any literals, so any type annotations or methods understood
query.go:219
↓ 35 callers
Method
Attr
Attr gets an attribute's value from the row. Example usage: r.Expr(r.Map{"key": "value"}).Attr("key") => "value"
query.go:439
↓ 19 callers
Method
Count
Count returns the number of elements in the response. Example usage: var response int err := r.Table("heroes").Count().Run(session).One(&response)
query.go:595
↓ 19 callers
Method
Err
Err returns the last error encountered, for example, a network error while contacting the database server, or while parsing. Example usage: err := r
rows.go:137
↓ 18 callers
Method
Run
Run runs a query using the given session, there is one Run() method for each type of query.
session.go:183
↓ 16 callers
Method
Add
Add sums two numbers or concatenates two arrays. Example usage: r.Expr(1,2,3).Add(r.Expr(4,5,6)) => [1,2,3,4,5,6] r.Expr(2).Add(2) => 4
query.go:449
↓ 16 callers
Method
Nth
Nth returns the nth element in sequence, zero-indexed. Example usage: var response int Get the second element of an array err := r.Expr(4,3,2,1).Nth
query.go:673
↓ 16 callers
Method
OrderBy
OrderBy sort the sequence by the values of the given key(s) in each row. The default sort is increasing. Example usage: var response []interface{} R
query.go:880
↓ 15 callers
Method
Update
Update updates rows in the database. Accepts a JSON document, a RQL expression, or a combination of the two. Example usage: var response r.WriteResp
query.go:1622
↓ 15 callers
Function
funcWrapper
(f interface{}, arity int)
query.go:133
↓ 14 callers
Method
Get
Get retrieves a single row by primary key. Example usage: var response map[string]interface{} err := r.Table("heroes").Get("Doctor Strange").Run(ses
query.go:334
↓ 13 callers
Method
Filter
Filter removes all objects from a sequence that do not match the given condition. The condition can be an RQL expression, an r.Map, or a function tha
query.go:826
↓ 13 callers
Method
Map
Map transforms a sequence by applying the given function to each row. Example usage: var squares []int Square a series of numbers square := func(row
query.go:757
↓ 12 callers
Method
Enum
()
ql2/ql2.pb.go:506
↓ 11 callers
Method
Reduce
Reduce iterates over a sequence, starting with a base value and applying a reduction function to the value so far and the next row of the sequence. E
query.go:935
↓ 9 callers
Function
Db
Db lets you perform operations within a specific database (this will override the database specified on the session). This can be used to access or c
query.go:1396
↓ 8 callers
Method
Eq
Eq returns true if two values are equal. Example usage: r.Expr(1).Eq(1) => true
query.go:512
↓ 8 callers
Method
Insert
Insert inserts rows into the database. If no value is specified for the primary key (by default "id"), a value will be generated by the server, e.g.
query.go:1576
↓ 8 callers
Function
Js
Terms // Js creates an expression using Javascript code. The code is executed on the server (using eval() https://developer.mozilla.org/en-US/docs/
query.go:283
↓ 8 callers
Method
Pluck
Derived Methods // Pluck takes only the given attributes from an object, discarding all others. See also .Without(). Example usage: var heroes []i
query.go:1027
↓ 7 callers
Method
Atomic
Atomic changes the required atomic-ness of a query. By default queries will only be run if they can be executed atomically, that is, all at once. If
query.go:1606
↓ 7 callers
Function
Branch
Branch checks a test expression, evaluating the trueBranch expression if it's true and falseBranch otherwise. Example usage: Roughly equivalent RQL
query.go:310
↓ 7 callers
Method
Gt
Gt returns true if the first value is greater than the second. Example usage: r.Expr(2).Gt(1) => true
query.go:530
↓ 7 callers
Function
Table
Table references all rows in a specific table, using the database that this method was called on. Example usage: var response []map[string]interface
query.go:1494
↓ 7 callers
Method
TableCreate
(name string)
query.go:1420
↓ 6 callers
Method
Merge
Merge combines an object with another object, overwriting properties from the first with properties from the second. Example usage: var response int
query.go:616
↓ 6 callers
Method
Replace
Replace replaces rows in the database. Accepts a JSON document or a RQL expression, and replaces the original document with the new one. The new row m
query.go:1641
↓ 5 callers
Method
CoerceTo
CoerceTo converts a value of one type to another type. You can convert: a selection, sequence, or object into an ARRAY, an array of pairs into an OBJ
query.go:1749
↓ 5 callers
Method
GetToken
()
ql2/ql2.pb.go:563
↓ 5 callers
Method
Lt
Lt returns true if the first value is less than the second. Example usage: r.Expr(1).Lt(2) => true
query.go:548
↓ 5 callers
Method
String
()
ql2/ql2.pb.go:801
↓ 5 callers
Function
runQuery
(c *test.C, pair ExpectPair)
basic_test.go:163
↓ 5 callers
Method
toTerm
toTerm converts an arbitrary object to a Term, within the context that toTerm was called on.
protobuf.go:29
↓ 4 callers
Method
Div
Div divides two numbers. Example usage: r.Expr(3).Div(2) => 1.5
query.go:476
↓ 4 callers
Method
GroupBy
GroupBy does a sort of grouped map reduce. First the server groups all rows that have the same value for `attribute`, then it applys the map reduce t
query.go:396
↓ 4 callers
Method
HasFields
HasFields returns true if an object has all the given attributes. Example usage: hero := r.Map{"name": "Iron Man", "energy": 6, "speed": 5} r.Expr(h
query.go:837
↓ 4 callers
Method
Mul
Mul multiplies two numbers. Example usage: r.Expr(2).Mul(3) => 6
query.go:467
↓ 4 callers
Method
Not
Not performs a logical not on a value. Example usage: r.Expr(true).Not() => false
query.go:566
↓ 4 callers
Method
Zip
Zip flattens the results of a join by merging the "left" and "right" fields of each row together. If any keys conflict, the "right" field takes prece
query.go:1268
↓ 3 callers
Method
And
And performs a logical and on two values. Example usage: r.Expr(true).And(true) => true
query.go:494
↓ 3 callers
Function
Asc
Asc tells OrderBy to sort a particular attribute in ascending order. This is the default sort. Example usage: var response []interface{} Retrieve v
query.go:894
↓ 3 callers
Method
ForEach
ForEach runs a given write query for each row of a sequence. Example usage: Delete all rows with the given ids var response r.WriteResponse Delete m
query.go:1683
↓ 3 callers
Method
Ge
Gt returns true if the first value is greater than or equal to the second. Example usage: r.Expr(2).Gt(2) => true
query.go:539
↓ 3 callers
Method
Next
Next moves the iterator forward by one document, returns false if there are no more rows or some sort of error has occurred (use .Err() to get the las
rows.go:89
↓ 3 callers
Method
Scan
Scan writes the current row into the provided variable, which must be passed by reference. NOTE: Scan uses json.Unmarshal internally and will not cle
rows.go:127
↓ 3 callers
Method
Without
Without removes the given attributes from an object. See also .Pluck(). Example usage: var heroes []interface{} err := r.Table("heroes").Without("r
query.go:1052
↓ 3 callers
Function
formatError
(message string, response *p.Response)
error.go:8
↓ 3 callers
Function
stringsToInterfaces
(strings []string)
query.go:125
↓ 2 callers
Method
All
All fetches all the results from an iterator into a reference to a slice. It may perform multiple network requests to the server until it has retriev
rows.go:149
↓ 2 callers
Method
Append
Append appends a value to an array. Example usage: var response []interface{} err := r.Expr(r.List{1, 2, 3, 4}).Append(5).Run(session).One(&response
query.go:630
↓ 2 callers
Function
Avg
Avg computes the average value of an attribute for a group, for use with the .GroupBy() method. Example usage: var response []interface{} err := r.T
query.go:1349
↓ 2 callers
Method
Between
Between gets all rows where the key attribute's value falls between the lowerbound and upperbound (inclusive). Use nil to represent no upper or lower
query.go:864
↓ 2 callers
Method
Close
Close closes the session, freeing any associated resources. Example usage: err := sess.Close()
session.go:73
↓ 2 callers
Method
Delete
Delete removes one or more rows from the database. Example usage: var response r.WriteResponse Delete a single row by id id := "5d93edbb-2882-4594-
query.go:1661
↓ 2 callers
Function
Desc
Desc tells OrderBy to sort a particular attribute in descending order. Example usage: var response []interface{} Retrieve villains in order of decre
query.go:905
↓ 2 callers
Method
EqJoin
EqJoin performs a join on two expressions, it is more efficient than .InnerJoin() and .OuterJoin() because it looks up elements in the right table by
query.go:1192
↓ 2 callers
Method
GetType
()
ql2/ql2.pb.go:818
↓ 2 callers
Method
Or
Or performs a logical or on two values. Example usage: r.Expr(true).Or(false) => true
query.go:503
↓ 2 callers
Method
Reconnect
Reconnect closes and re-opens a session. Example usage: err := sess.Reconnect()
session.go:57
↓ 2 callers
Method
Skip
Skip returns all results after the first `start` results. Basically it's the opposite of .Limit(). Example usage: var response []int err := r.Expr(
query.go:717
↓ 2 callers
Method
Sub
Sub subtracts two numbers. Example usage: r.Expr(2).Sub(2) => 0
query.go:458
↓ 2 callers
Method
TypeOf
TypeOf returns the type of the expression. Example usage: var response string err := r.Expr(1).TypeOf().Run(session).One(&response) Example respons
query.go:1718
↓ 2 callers
Method
Union
Union concatenates two sequences. Example usage: var response []interface{} Retrieve all heroes and villains r.Table("heroes").Union(r.Table("villai
query.go:658
↓ 2 callers
Method
buildProtobuf
buildProtobuf converts a query to a protobuf and catches any panics raised by the toProtobuf() functions.
protobuf.go:529
↓ 2 callers
Function
datumUnmarshal
(datum *p.Datum, v interface{})
datum.go:34
↓ 2 callers
Method
executeQuery
executeQuery is an internal function, shared by Rows iterator and the normal Run() call. Runs a protocol buffer formatted query, returns a list of str
conn.go:143
↓ 2 callers
Method
getContext
()
session.go:177
↓ 2 callers
Function
nextVariableNumber
()
protobuf.go:336
↓ 2 callers
Function
paramsToTerm
(params []int64)
protobuf.go:438
↓ 2 callers
Function
protobufToString
(p proto.Message, indentLevel int)
utils.go:29
↓ 2 callers
Function
resetDatabase
(c *test.C)
basic_test.go:62
↓ 1 callers
Method
ConcatMap
ConcatMap constructs a sequence by running the provided function on each row, then concatenating all the results. Example usage: var flattened []int
query.go:787
↓ 1 callers
Function
Connect
Connect creates a new database session. NOTE: You probably should not share sessions between goroutines. Example usage: sess, err := r.Connect("loc
session.go:38
↓ 1 callers
Function
Count
Count counts the number of rows in a group, for use with the .GroupBy() method. Example usage: var response []interface{} Count all heroes in each s
query.go:1294
↓ 1 callers
Function
DbCreate
DbCreate creates a database with the supplied name. Example usage: err := r.DbCreate("marvel").Run(session).Exec()
query.go:1358
↓ 1 callers
Function
DbDrop
DbDrop deletes the specified database Example usage: err := r.DbDrop("marvel").Run(session).Exec()
query.go:1367
↓ 1 callers
Method
Distinct
Distinct removes duplicate elements from a sequence. Example usage: var response []interface{} Get a list of all possible strength values for our he
query.go:581
↓ 1 callers
Method
Error
()
error.go:58
↓ 1 callers
Method
GetBacktrace
()
ql2/ql2.pb.go:689
↓ 1 callers
Method
GetFrames
()
ql2/ql2.pb.go:649
↓ 1 callers
Method
GetKey
()
ql2/ql2.pb.go:856
↓ 1 callers
Method
GetRArray
()
ql2/ql2.pb.go:753
↓ 1 callers
Method
GetRBool
()
ql2/ql2.pb.go:732
↓ 1 callers
Method
GetRNum
()
ql2/ql2.pb.go:739
↓ 1 callers
Method
GetRObject
()
ql2/ql2.pb.go:760
↓ 1 callers
Method
GetRStr
()
ql2/ql2.pb.go:746
↓ 1 callers
Method
GetResponse
()
ql2/ql2.pb.go:682
↓ 1 callers
Method
GetVal
()
ql2/ql2.pb.go:863
↓ 1 callers
Method
GroupedMapReduce
GroupedMapReduce partitions a sequence into groups, then performs a map and a reduction on each group. See also .Map() and .GroupBy(). Example usage
query.go:1002
↓ 1 callers
Method
InnerJoin
InnerJoin performs an inner join on two sequences, using the provided function to compare the rows from each sequence. See also .EqJoin() and .OuterJo
query.go:1095
↓ 1 callers
Method
Le
Le returns true if the first value is less than or equal to the second. Example usage: r.Expr(2).Lt(2) => true
query.go:557
↓ 1 callers
Method
Limit
Limit returns only the first `limit` results from the query. Example usage: var response []int err := r.Expr(1,2,3,4,5).Limit(3).Run(session).One(&r
query.go:702
↓ 1 callers
Method
Mod
Mod divides two numbers and returns the remainder. Example usage: r.Expr(23).Mod(10) => 3
query.go:485
↓ 1 callers
Method
One
One gets the first result from a query response. Example usage: var result interface{} err := r.Table("villains").Get("Galactus", "name").Run(sessio
rows.go:205
↓ 1 callers
Method
OuterJoin
OuterJoin performs a left outer join on two sequences, using the provided function to compare the rows from each sequence. See also .EqJoin() and .Inn
query.go:1155
↓ 1 callers
Function
SetDebug
SetDebug causes all queries sent to the server and responses received to be printed to stdout in raw form. Example usage: r.SetDebug(true)
conn.go:65
↓ 1 callers
Method
Slice
Slice returns a section of a sequence, with bounds [lower, upper), where lower bound is inclusive and upper bound is exclusive. Example usage: var r
query.go:688
↓ 1 callers
Method
String
()
ql2/ql2.pb.go:37
↓ 1 callers
Method
String
()
ql2/ql2.pb.go:76
next →
1–100 of 256, ranked by callers