mongoext

package
v0.0.439 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGoExtBsonRegistry

func CreateGoExtBsonRegistry() *bsoncodec.Registry

func FixTextSearchPipeline added in v0.0.116

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 added in v0.0.116

func ProjectionFromStruct(obj interface{}) 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