bson

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 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
}

type Entry

type Entry bson.E

func (Entry) MarshalBJSON

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

type Float added in v0.0.26

type Float interface {
	~float32 | ~float64
}

type ID

type ID interface {
	~string | Number | primitive.ObjectID
}

type Int added in v0.0.26

type Int interface {
	~int | ~int32 | ~int64
}

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) PutAsHash added in v0.0.26

func (m *Map) PutAsHash(key, hashKey string, val any) *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

type Number added in v0.0.26

type Number interface {
	Int | Float
}

Jump to

Keyboard shortcuts

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