method

Value.Lookup

Read an immutable object child and report whether the key exists.

Example

go
seo := store.Object(store.Values{"title": store.Null()})
title, exists := seo.Lookup("title")
// exists is true even though title is null.

Arguments

ArgumentTypeDescription
namestringA literal direct-child name; dots do not traverse nested objects.

Returns

The child and true when the key exists, including explicit Null; false for a missing key or a non-object.

(Value, bool)

Full signature

func (value Value) Lookup(name string) (Value, bool)

Source store/value.go:118

Related types

  • Value

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

Related guides