summaryrefslogtreecommitdiff
path: root/ext/librethinkdbxx/test/upstream/transform/table.yaml
blob: 9f14c90a2ab10b8fe07c2e6d25d64cbb6ddc3664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
desc: Tests manipulation operations on tables
table_variable_name: tbl
tests:
    # Add some data
    - cd: tbl.insert([{"a":["k1","v1"]},{"a":["k2","v2"]}])

    # Coerce to an object (after map)
    - js: tbl.map(r.row("a")).coerce_to("object")
      rb: tbl.map{|row| row["a"]}.coerce_to("object")
      py: tbl.map(r.row["a"]).coerce_to("object")
      ot: {"k1":"v1","k2":"v2"}

    # Coerce to an array
    - cd: tbl.limit(1).type_of()
      ot: "SELECTION<STREAM>"

    - cd: tbl.limit(1).coerce_to('array').type_of()
      ot: "ARRAY"