List Type

List Type

CUE Reference: https://cuelang.org/docs/tutorials/tour/types/lists

List Field

field_name: [...string] | [...number] | [...float] | [...int] | [...bool]
or in the general from
field_name: [...type] [& type]
  • Note: type is optional, if not provided it will be detected using the values inside the list.

Examples

String & Number List

string_list: ["ana", "bob", "may"] int_list: [1, 2, 3] & [...int]

CSV Example Output

string_listint_list
ana3
ana2
bob1
may3

JSON Example Output

[ { "int_list": 3, "string_list": "ana" }, { "int_list": 2, "string_list": "ana" }, { "int_list": 1, "string_list": "bob" }, { "int_list": 3, "string_list": "may" } ]