mongoext

package
v0.0.644 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGoExtBsonRegistry

func CreateGoExtBsonRegistry() *bson.Registry

func FixTextSearchPipeline

func FixTextSearchPipeline(pipeline mongo.Pipeline) mongo.Pipeline

FixTextSearchPipeline moves {$match:{$text:{$search}}} entries to the front of the pipeline (otherwise its an mongo error)

func ProjectionFromStruct

func ProjectionFromStruct(obj any) bson.M

ProjectionFromStruct automatically generated a mongodb projection for a struct This way you can pretty much always write `options.FindOne().SetProjection(mongoutils.ProjectionFromStruct(...your_model...))` to only get the data from mongodb that you will actually use in the later decode step

Types

This section is empty.

Jump to

Keyboard shortcuts

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