insort

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 12 Imported by: 0

README

insort

Sort + limit $in / $nin queries

Documentation

Index

Constants

View Source
const Name = "insort"

Variables

This section is empty.

Functions

func PreprocessFilter

func PreprocessFilter(filter bson.D, inLimit int) error

Types

type BsonDSlice

type BsonDSlice []bson.E

func (BsonDSlice) Len

func (p BsonDSlice) Len() int

func (BsonDSlice) Less

func (p BsonDSlice) Less(i, j int) bool

func (BsonDSlice) Sort

func (p BsonDSlice) Sort()

func (BsonDSlice) Swap

func (p BsonDSlice) Swap(i, j int)

type GenericSlice

type GenericSlice []interface{}

func (GenericSlice) Len

func (p GenericSlice) Len() int

func (GenericSlice) Less

func (p GenericSlice) Less(i, j int) bool

func (GenericSlice) Sort

func (p GenericSlice) Sort()

func (GenericSlice) Swap

func (p GenericSlice) Swap(i, j int)

type InLenError

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

func (InLenError) BSONError

func (i InLenError) BSONError() bson.D

TODO: better interface? TODO: better code?

func (InLenError) Error

func (i InLenError) Error() string

type InSortPlugin

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

This is a plugin that handles sending the request to the acutual downstream mongo

func (*InSortPlugin) Configure

func (p *InSortPlugin) Configure(d bson.D) error

Configure configures this plugin with the given configuration object. Returns an error if the configuration is invalid for the plugin.

func (*InSortPlugin) Name

func (p *InSortPlugin) Name() string

func (*InSortPlugin) Process

func (p *InSortPlugin) Process(ctx context.Context, r *plugins.Request, next plugins.PipelineFunc) (bson.D, error)

Process is the function executed when a message is called in the pipeline.

type InSortPluginConfig

type InSortPluginConfig struct {
	InLimit int `bson:"inlimit"`
}

Jump to

Keyboard shortcuts

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