bsonx

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func A

func A(values ...any) bson.A

func D

func D(key string, value any) bson.D

func E

func E(key string, value any) bson.E

func Id

func Id(value any) bson.M

func M

func M(key string, value any) bson.M

func MapToBsonM

func MapToBsonM(data map[string]any) bson.M

func StringSortToBsonD added in v2.1.0

func StringSortToBsonD(sorts ...string) bson.D

StringSortToBsonD transform string sort to bson D "-created_at" => bson.D{{"created_at", -1}} []string{"age", "-created_at"} => bson.D{{"age", 1}, {"created_at", -1}}

func ToBsonM

func ToBsonM(data any) bson.M

Types

type DBuilder

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

DBuilder is a builder for bson.D

func NewD

func NewD() *DBuilder

func (*DBuilder) Add

func (b *DBuilder) Add(key string, value any) *DBuilder

func (*DBuilder) Build

func (b *DBuilder) Build() bson.D

Jump to

Keyboard shortcuts

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