method

Value.Len

Count direct object members or list items without copying.

Example

go
tags := store.List(store.String("news"))
count := tags.Len() // 1

Returns

The number of members or items, or zero for other kinds.

int

How it works

Use Kind when an empty container must be distinguished from a scalar.

Full signature

Related types

  • Value

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

Related guides