method

Value.Entries

Iterate immutable object members without copying the map.

Example

go
seo := store.Object(store.Values{"title": store.String("Home")})
for name, value := range seo.Entries() {
  fmt.Println(name, value.Kind())
}

Returns

An iterator yielding each direct-child name and value, in unspecified order.

iter.Seq2[string, Value]

How it works

Non-objects yield no entries. The iterator keeps its snapshot and can be reused, including after an early stop.

Full signature

func (value Value) Entries() iter.Seq2[string, Value]

Source store/value.go:151

Related types

  • Value

    An immutable scalar, object, list, or populated document value.

Related guides