qb

package
v0.0.0-...-6524a5b Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Builtins = map[string]interface{}{
	"oid":   oid,
	"regex": regex,
}

Builtins contains all the currently registered functions that can be used when templating query templates. Publicly exposed so that callers can add their own conversion functions.

Functions

func Build

func Build[T bson.M | bson.D | bson.A | bson.E](query string, vars map[string]any) (out T, err error)

Build builds a MongoDB query of type T given an input query template. The caller may optionally provide variables that will be templated into the query. The caller may also use any of the registered functions above to handle special types of variables such as the ObjectIds or regular expressions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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