github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/doc/tutorial/basics/4_references/20_selectors.txt (about) 1 cue eval selectors.cue 2 cmp stdout expect-stdout-cue 3 4 -- frontmatter.toml -- 5 title = "Accessing Fields" 6 description = "" 7 8 -- text.md -- 9 Selectors access fields within a struct using the `.` notation. 10 This only works if a field name is a valid identifier and it is not computed. 11 For other cases one can use the indexing notation. 12 13 -- selectors.cue -- 14 a: { 15 b: 2 16 "c-e": 5 17 } 18 v: a.b 19 w: a["c-e"] 20 21 -- expect-stdout-cue -- 22 a: { 23 b: 2 24 "c-e": 5 25 } 26 v: 2 27 w: 5