bson

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Null = primitive.Null{}
	Nil  = Null
)

Functions

This section is empty.

Types

type Doc

type Doc[I ID] interface {
	GetID() I
	bson.Marshaler
	bson.Unmarshaler
}

type Entry

type Entry bson.E

func (Entry) MarshalBJSON

func (e Entry) MarshalBJSON() ([]byte, error)

type ID

type ID interface {
	~string | primitive.ObjectID
}

type Map

type Map struct {
	// contains filtered or unexported fields
}

func FromD

func FromD(d rawbson.D) *Map

func FromM

func FromM(m rawbson.M) *Map

func NewMap

func NewMap() *Map

func (*Map) Entries

func (m *Map) Entries() []Entry

func (*Map) Get

func (m *Map) Get(key string) (any, bool)

func (*Map) MarshalBSON

func (m *Map) MarshalBSON() ([]byte, error)

func (*Map) MarshalJSON

func (m *Map) MarshalJSON() ([]byte, error)

func (*Map) Put

func (m *Map) Put(key string, value any) *Map

func (*Map) PutAsArray

func (m *Map) PutAsArray(key string, others ...*Map)

func (*Map) Raw

func (m *Map) Raw() rawbson.D

func (*Map) ToMap

func (m *Map) ToMap() map[string]any

func (*Map) UnmarshalBSON

func (m *Map) UnmarshalBSON(bytes []byte) error

func (*Map) UnmarshalJSON

func (m *Map) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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