@@ -4,108 +4,110 @@ import (
4
4
p "github.com/dancannon/gorethink/ql2"
5
5
)
6
6
7
- // Returns the currently visited document.
7
+ // Row returns the currently visited document.
8
8
var Row = constructRootTerm ("Doc" , p .Term_IMPLICIT_VAR , []interface {}{}, map [string ]interface {}{})
9
9
10
+ // Literal replaces an object in a field instead of merging it with an existing
11
+ // object in a merge or update operation.
10
12
func Literal (args ... interface {}) Term {
11
13
return constructRootTerm ("Literal" , p .Term_LITERAL , args , map [string ]interface {}{})
12
14
}
13
15
14
- // Get a single field from an object. If called on a sequence, gets that field
16
+ // Field gets a single field from an object. If called on a sequence, gets that field
15
17
// from every object in the sequence, skipping objects that lack it.
16
18
func (t Term ) Field (args ... interface {}) Term {
17
19
return constructMethodTerm (t , "Field" , p .Term_GET_FIELD , args , map [string ]interface {}{})
18
20
}
19
21
20
- // Test if an object has all of the specified fields. An object has a field if
22
+ // HasFields tests if an object has all of the specified fields. An object has a field if
21
23
// it has the specified key and that key maps to a non-null value. For instance,
22
24
// the object `{'a':1,'b':2,'c':null}` has the fields `a` and `b`.
23
25
func (t Term ) HasFields (args ... interface {}) Term {
24
26
return constructMethodTerm (t , "HasFields" , p .Term_HAS_FIELDS , args , map [string ]interface {}{})
25
27
}
26
28
27
- // Plucks out one or more attributes from either an object or a sequence of
29
+ // Pluck plucks out one or more attributes from either an object or a sequence of
28
30
// objects (projection).
29
31
func (t Term ) Pluck (args ... interface {}) Term {
30
32
return constructMethodTerm (t , "Pluck" , p .Term_PLUCK , args , map [string ]interface {}{})
31
33
}
32
34
33
- // The opposite of pluck; takes an object or a sequence of objects, and returns
35
+ // Without is the opposite of pluck; takes an object or a sequence of objects, and returns
34
36
// them with the specified paths removed.
35
37
func (t Term ) Without (args ... interface {}) Term {
36
38
return constructMethodTerm (t , "Without" , p .Term_WITHOUT , args , map [string ]interface {}{})
37
39
}
38
40
39
- // Merge two objects together to construct a new object with properties from both.
41
+ // Merge merges two objects together to construct a new object with properties from both.
40
42
// Gives preference to attributes from other when there is a conflict.
41
43
func (t Term ) Merge (args ... interface {}) Term {
42
44
return constructMethodTerm (t , "Merge" , p .Term_MERGE , funcWrapArgs (args ), map [string ]interface {}{})
43
45
}
44
46
45
- // Append a value to an array.
47
+ // Append appends a value to an array.
46
48
func (t Term ) Append (args ... interface {}) Term {
47
49
return constructMethodTerm (t , "Append" , p .Term_APPEND , args , map [string ]interface {}{})
48
50
}
49
51
50
- // Prepend a value to an array.
52
+ // Prepend prepends a value to an array.
51
53
func (t Term ) Prepend (args ... interface {}) Term {
52
54
return constructMethodTerm (t , "Prepend" , p .Term_PREPEND , args , map [string ]interface {}{})
53
55
}
54
56
55
- // Remove the elements of one array from another array.
57
+ // Difference removes the elements of one array from another array.
56
58
func (t Term ) Difference (args ... interface {}) Term {
57
59
return constructMethodTerm (t , "Difference" , p .Term_DIFFERENCE , args , map [string ]interface {}{})
58
60
}
59
61
60
- // Add a value to an array and return it as a set (an array with distinct values).
62
+ // SetInsert adds a value to an array and return it as a set (an array with distinct values).
61
63
func (t Term ) SetInsert (args ... interface {}) Term {
62
64
return constructMethodTerm (t , "SetInsert" , p .Term_SET_INSERT , args , map [string ]interface {}{})
63
65
}
64
66
65
- // Add a several values to an array and return it as a set (an array with
67
+ // SetUnion adds several values to an array and return it as a set (an array with
66
68
// distinct values).
67
69
func (t Term ) SetUnion (args ... interface {}) Term {
68
70
return constructMethodTerm (t , "SetUnion" , p .Term_SET_UNION , args , map [string ]interface {}{})
69
71
}
70
72
71
- // Intersect two arrays returning values that occur in both of them as a set (an
72
- // array with distinct values).
73
+ // SetIntersection calculates the intersection of two arrays returning values that
74
+ // occur in both of them as a set (an array with distinct values).
73
75
func (t Term ) SetIntersection (args ... interface {}) Term {
74
76
return constructMethodTerm (t , "SetIntersection" , p .Term_SET_INTERSECTION , args , map [string ]interface {}{})
75
77
}
76
78
77
- // Remove the elements of one array from another and return them as a set (an
79
+ // SetDifference removes the elements of one array from another and return them as a set (an
78
80
// array with distinct values).
79
81
func (t Term ) SetDifference (args ... interface {}) Term {
80
82
return constructMethodTerm (t , "SetDifference" , p .Term_SET_DIFFERENCE , args , map [string ]interface {}{})
81
83
}
82
84
83
- // Insert a value in to an array at a given index. Returns the modified array.
85
+ // InsertAt inserts a value in to an array at a given index. Returns the modified array.
84
86
func (t Term ) InsertAt (args ... interface {}) Term {
85
87
return constructMethodTerm (t , "InsertAt" , p .Term_INSERT_AT , args , map [string ]interface {}{})
86
88
}
87
89
88
- // Insert several values in to an array at a given index. Returns the modified array.
90
+ // SpliceAt inserts several values in to an array at a given index. Returns the modified array.
89
91
func (t Term ) SpliceAt (args ... interface {}) Term {
90
92
return constructMethodTerm (t , "SpliceAt" , p .Term_SPLICE_AT , args , map [string ]interface {}{})
91
93
}
92
94
93
- // Remove an element from an array at a given index. Returns the modified array.
95
+ // DeleteAt removes an element from an array at a given index. Returns the modified array.
94
96
func (t Term ) DeleteAt (args ... interface {}) Term {
95
97
return constructMethodTerm (t , "DeleteAt" , p .Term_DELETE_AT , args , map [string ]interface {}{})
96
98
}
97
99
98
- // Change a value in an array at a given index. Returns the modified array.
100
+ // ChangeAt changes a value in an array at a given index. Returns the modified array.
99
101
func (t Term ) ChangeAt (args ... interface {}) Term {
100
102
return constructMethodTerm (t , "ChangeAt" , p .Term_CHANGE_AT , args , map [string ]interface {}{})
101
103
}
102
104
103
- // Return an array containing all of the object's keys.
105
+ // Keys returns an array containing all of the object's keys.
104
106
func (t Term ) Keys (args ... interface {}) Term {
105
107
return constructMethodTerm (t , "Keys" , p .Term_KEYS , args , map [string ]interface {}{})
106
108
}
107
109
108
- // Creates an object from a list of key-value pairs, where the keys must be strings.
110
+ // Object creates an object from a list of key-value pairs, where the keys must be strings.
109
111
func Object (args ... interface {}) Term {
110
112
return constructRootTerm ("Object" , p .Term_OBJECT , args , map [string ]interface {}{})
111
113
}
0 commit comments