update

package
v0.41.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 3 Imported by: 42

Documentation

Index

Constants

View Source
const (
	// DeleteField is used as a value in a call to update or Set with merge to indicate
	// that the corresponding child should be deleted.
	DeleteField sentinel = iota

	// ServerTimestamp is used as a value in a call to update to indicate that the
	// child's value should be set to the time at which the server processed
	// the request.
	//
	// ServerTimestamp must be the value of a fieldName directly; it cannot appear in
	// array or struct values, or in any value that is itself inside an array or
	// struct.
	ServerTimestamp
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldPath

type FieldPath []string

A FieldPath is a non-empty sequence of non-empty fields that reference a value.

A FieldPath value should only be necessary if one of the fieldName names contains one of the runes ".˜*/[]". Most methods accept a simpler form of fieldName path as a string in which the individual fields are separated by dots. For example,

[]string{"a", "b"}

is equivalent to the string form

"a.b"

but

[]string{"*"}

has no equivalent string form.

type Update

type Update interface {
	FieldName() string
	FieldPath() FieldPath
	Value() any
}

func ByFieldName

func ByFieldName(fieldName string, value any) Update

func ByFieldPath

func ByFieldPath(fieldPath FieldPath, value any) Update

func DeleteByFieldName added in v0.18.1

func DeleteByFieldName(fieldName string) Update

func DeleteByFieldPath added in v0.18.1

func DeleteByFieldPath(path ...string) Update

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL