operators

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Double       BSONType = 1
	String                = 2
	Object                = 3
	Array                 = 4
	Binary                = 5
	Undefined             = 6
	ObjectId              = 7
	Boolean               = 8
	Date                  = 9
	Null                  = 10
	RegExp                = 11
	JavaScript            = 13
	Symbol                = 14
	JavaScriptWS          = 15
	Int32                 = 16
	Timestamp             = 17
	Int64                 = 18
	MinKey                = -1
	MaxKey                = 127
)

Variables

This section is empty.

Functions

func All

func All(field Field, values ...interface{}) bson.M

All Matches arrays that contain all elements specified in the query.

func And

func And(clauses ...bson.M) bson.M

And Joins query clauses with a logical AND returns all documents that match the conditions of both clauses.

func Comment

func Comment(comment string) bson.M

Comment Adds a comment to a query predicate.

func Eq

func Eq(field Field, value interface{}) bson.M

Eq Matches values that are equal to a specified value.

func Exists

func Exists(field Field, exists bool) bson.M

Exists Matches documents that have the specified field.

func Gt

func Gt(field Field, value interface{}) bson.M

Gt Matches values that are greater than a specified value.

func Gte

func Gte(field Field, value interface{}) bson.M

Gte Matches values that are greater than or equal to a specified value.

func In

func In(field Field, values ...interface{}) bson.M

In Matches any of the values.

func Lt

func Lt(field Field, value interface{}) bson.M

Lt Matches values that are less than a specified value.

func Lte

func Lte(field Field, value interface{}) bson.M

Lte Matches values that are less than or equal to a specified value.

func Mod

func Mod(field Field, divisor, remainder float64) bson.M

Mod Performs a modulo operation on the value of a field and selects documents with a specified result.

func Ne

func Ne(field Field, value interface{}) bson.M

Ne Matches all values that are not equal to a specified value.

func Nin

func Nin(field Field, values ...interface{}) bson.M

Nin Matches none of the values.

func Nor

func Nor(clauses ...bson.M) bson.M

Nor Joins query clauses with a logical NOR returns all documents that fail to match both clauses.

func Not

func Not(expr bson.M) bson.M

Not Inverts the effect of a query expression and returns documents that do not match the query expression.

func Or

func Or(clauses ...bson.M) bson.M

Or Joins query clauses with a logical OR returns all documents that match the conditions of either clause.

func RegEx

func RegEx(field Field, regexp, options string) bson.M

RegEx Selects documents where values match a specified regular expression.

func Size

func Size(field Field, count int) bson.M

Size Selects documents if the array field is a specified size.

func Text

func Text(field Field, search, lang string) bson.M

Text performs a text search on the content of the fields indexed with a text index.

func Type

func Type(field Field, t BSONType) bson.M

Type Selects documents if a field is of the specified type.

func Where

func Where(field Field, code string, scope interface{}) bson.M

Where Matches documents that satisfy a JavaScript expression.

Types

type BSONType

type BSONType int

type Field

type Field interface {
	String() string
}

Jump to

Keyboard shortcuts

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