File: example_query_manipulation_test.go

package info (click to toggle)
golang-gopkg-gorethink-gorethink.v3 3.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,464 kB
  • sloc: python: 1,382; makefile: 15; sh: 9
file content (25 lines) | stat: -rw-r--r-- 326 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package gorethink

import (
	"fmt"
)

// Get john's age
func ExampleTerm_Field() {
	cur, err := DB("examples").Table("users").Get("john").Field("age").Run(session)
	if err != nil {
		fmt.Print(err)
		return
	}

	var res int
	err = cur.One(&res)
	if err != nil {
		fmt.Print(err)
		return
	}

	fmt.Print(res)

	// Output: 19
}