Documentation ¶
Index ¶
- func Pipe(stage ...Condition) bson.M
- type Condition
- func BoolMatch(c Condition) Condition
- func DateGreaterThanOrEqualTo(c Condition) Condition
- func DateLessThanOrEqualTo(c Condition) Condition
- func ElemMatch(c Condition) Condition
- func EqualTo(c Condition) Condition
- func InArray(c Condition) Condition
- func NotEqualTo(c Condition) Condition
- func NumberMatch(c Condition) Condition
- func ObjectIdMatch(c Condition) Condition
- func StringEndsWith(c Condition) Condition
- func StringLike(c Condition) Condition
- func StringMatch(c Condition) Condition
- func StringStartsWith(c Condition) Condition
- type ConditionOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Condition ¶
type Condition struct { Key string Value interface{} }
Used in most condition operators. The Key is used to specify the field in the collection that is being queried and the value is the query itself. This query could be a new condition.Pipe
func DateGreaterThanOrEqualTo ¶
Uses the $gte operator and the time.Parse function to filter documents where the document provided field is greater than or equal to the specified field.
func DateLessThanOrEqualTo ¶
Uses the $lte operator and the time.Parse function to filter documents where the document provided field is less than or equal to the specified field.
func ElemMatch ¶
Uses the $elemMatch operator to matche documents that contain an array field with at least one element that matches all the specified query criteria.
func NotEqualTo ¶
Uses the $ne operator to filter values that do not match the provided value of any type in a MongoDB document.
func NumberMatch ¶
Uses the $eq operator to filter on a matching number value in a MongoDB document.
func ObjectIdMatch ¶
Uses the $eq operator and the util.StringToObjectId function to find a matching ObjectID in a MongoDB document.
func StringEndsWith ¶
Uses the $regex operator to match a string that ends with the provided string in a MongoDB document.
func StringLike ¶
Uses the $regex operator to match any part of a string in a MongoDB document.
func StringMatch ¶
Uses the $regex operator to match a whole string in a MongoDB document.
func StringStartsWith ¶
Uses the $regex operator to match a string that starts with the provided string in a MongoDB document.
type ConditionOperation ¶
The ConditionOperation is a simple type alias for the bson.M type and allows for more simple conversions