query

package
v0.0.0-...-f078915 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

query

import "github.com/blueprint-uservices/blueprint/runtime/plugins/simplenosqldb/query"

Index

type CmpType

type CmpType int

const (
    Eq  CmpType = iota
    Gt
    Gte
    Lt
    Lte
)

type Filter

type Filter interface {
    Apply(item any) bool
    String() string
}

func All
func All(filters ...Filter) Filter

func And
func And(filters ...Filter) Filter

func Broadcast
func Broadcast(next Filter) Filter

func CmpFloat
func CmpFloat(value float64, cmp CmpType) Filter

func CmpInt
func CmpInt(value int64, cmp CmpType) Filter

func ElemMatch
func ElemMatch(queries ...Filter) Filter

func Equals
func Equals(value any) Filter

func ExactFieldMatch
func ExactFieldMatch(fieldsSeen ...string) Filter

func Exists
func Exists() Filter

func Index
func Index(i int, next Filter) Filter

func Lookup
func Lookup(selector string, next Filter) Filter

func Not
func Not(filter Filter) Filter

func Or
func Or(filters ...Filter) Filter

func ParseFilter
func ParseFilter(filter bson.D) (Filter, error)

func Regex
func Regex(regex_string string) (Filter, error)

func Select
func Select(fieldName string, next Filter) Filter

type Update

type Update interface {
    Apply(itemRef any) error
    String() string
}

func AddToSet
func AddToSet(value any) (Update, error)

func BroadcastUpdate
func BroadcastUpdate(update Update) Update

func IncInt
func IncInt(amount int64) Update

func ParseUpdate
func ParseUpdate(update bson.D) (Update, error)

func PullMatches
func PullMatches(filter Filter) (Update, error)

func PushValue
func PushValue(value any) (Update, error)

func SetValue
func SetValue(value any) (Update, error)

func UnsetElement
func UnsetElement(index int) Update

func UnsetField
func UnsetField(fieldName string) Update

func UnsetPath
func UnsetPath(selector string) Update

func UpdateAll
func UpdateAll(updates []Update) Update

func UpdateField
func UpdateField(fieldName string, update Update, createIfAbsent bool) Update

func UpdateIndex
func UpdateIndex(index int, update Update, createIfAbsent bool) Update

func UpdatePath
func UpdatePath(selector string, update Update) Update

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmpType

type CmpType int
const (
	Eq CmpType = iota
	Gt
	Gte
	Lt
	Lte
)

type Filter

type Filter interface {
	Apply(item any) bool
	String() string
}

func All

func All(filters ...Filter) Filter

func And

func And(filters ...Filter) Filter

func Broadcast

func Broadcast(next Filter) Filter

func CmpFloat

func CmpFloat(value float64, cmp CmpType) Filter

func CmpInt

func CmpInt(value int64, cmp CmpType) Filter

func ElemMatch

func ElemMatch(queries ...Filter) Filter

func Equals

func Equals(value any) Filter

func ExactFieldMatch

func ExactFieldMatch(fieldsSeen ...string) Filter

func Exists

func Exists() Filter

func Index

func Index(i int, next Filter) Filter

func Lookup

func Lookup(selector string, next Filter) Filter

func Not

func Not(filter Filter) Filter

func Or

func Or(filters ...Filter) Filter

func ParseFilter

func ParseFilter(filter bson.D) (Filter, error)

func Regex

func Regex(regex_string string) (Filter, error)

func Select

func Select(fieldName string, next Filter) Filter

type Update

type Update interface {
	Apply(itemRef any) error
	String() string
}

func AddToSet

func AddToSet(value any) (Update, error)

func BroadcastUpdate

func BroadcastUpdate(update Update) Update

func IncInt

func IncInt(amount int64) Update

func ParseUpdate

func ParseUpdate(update bson.D) (Update, error)

func PullMatches

func PullMatches(filter Filter) (Update, error)

func PushValue

func PushValue(value any) (Update, error)

func SetValue

func SetValue(value any) (Update, error)

func UnsetElement

func UnsetElement(index int) Update

func UnsetField

func UnsetField(fieldName string) Update

func UnsetPath

func UnsetPath(selector string) Update

func UpdateAll

func UpdateAll(updates []Update) Update

func UpdateField

func UpdateField(fieldName string, update Update, createIfAbsent bool) Update

func UpdateIndex

func UpdateIndex(index int, update Update, createIfAbsent bool) Update

func UpdatePath

func UpdatePath(selector string, update Update) Update

Jump to

Keyboard shortcuts

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