Documentation ¶
Index ¶
- Constants
- func IsQueryFormat(s string) bool
- func Multiple(query Filter) bool
- type Filter
- func (this Filter) AND(v interface{})
- func (this Filter) Any(t, k string, v interface{})
- func (this Filter) Eq(k string, v interface{})
- func (this Filter) Gt(k string, v interface{})
- func (this Filter) Gte(k string, v interface{})
- func (this Filter) In(k string, v interface{})
- func (this Filter) Lt(k string, v interface{})
- func (this Filter) Lte(k string, v interface{})
- func (this Filter) Marshal() ([]byte, error)
- func (this Filter) Match(t string, v interface{})
- func (this Filter) NOR(v interface{})
- func (this Filter) NOT(v interface{})
- func (this Filter) Ne(k string, v interface{})
- func (this Filter) Nin(k string, v ...interface{})
- func (this Filter) OR(v interface{})
- func (this Filter) Primary(v interface{})
- func (this Filter) String() string
- type Node
- type Query
- func (this Query) AND(v ...*Node)
- func (q *Query) Build(model *schema.Schema) Filter
- func (q *Query) Eq(k string, v interface{})
- func (q *Query) Gt(k string, v interface{})
- func (q *Query) Gte(k string, v interface{})
- func (q *Query) In(k string, v interface{})
- func (q *Query) Len() (r int)
- func (q *Query) Lt(k string, v interface{})
- func (q *Query) Lte(k string, v interface{})
- func (q *Query) Marshal() ([]byte, error)
- func (this Query) NOR(v ...*Node)
- func (this Query) NOT(v ...*Node)
- func (q *Query) Ne(k string, v interface{})
- func (q *Query) Nin(k string, v interface{})
- func (this Query) OR(v ...*Node)
- func (q *Query) Primary(v interface{})
- func (q *Query) String() string
- func (q *Query) Where(format interface{}, cons ...interface{})
Constants ¶
const ( MongoPrimaryName = "_id" QueryOperationPrefix = "$" )
const ( QueryOperationOR = "or" QueryOperationAND = "and" QueryOperationNOT = "not" QueryOperationNOR = "nor" )
Variables ¶
This section is empty.
Functions ¶
func IsQueryFormat ¶
Types ¶
type Filter ¶
func (Filter) AND ¶
func (this Filter) AND(v interface{})
AND $and performs a logical AND operation on an array of one or more expressions (e.g. <expression1>, <expression2>, etc.) and selects the documents that satisfy all the expressions in the array. The $and operator uses short-circuit evaluation. If the first expression (e.g. <expression1>) evaluates to false, MongoDB will not evaluate the remaining expressions.
func (Filter) In ¶
In The $in operator selects the documents where the value of a field equals any value in the specified array
func (Filter) NOR ¶
func (this Filter) NOR(v interface{})
NOR $nor performs a logical NOR operation on an array of one or more query expression and selects the documents that fail all the query expressions in the array.
func (Filter) NOT ¶
func (this Filter) NOT(v interface{})
NOT $not performs a logical NOT operation on the specified <operator-expression> and selects the documents that do not match the <operator-expression>. This includes documents that do not contain the field.
func (Filter) Nin ¶
Nin selects the documents where: the field value is not in the specified array or the field does not exist.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (Query) AND ¶
AND $and performs a logical AND operation on an array of one or more expressions (e.g. <expression1>, <expression2>, etc.) and selects the documents that satisfy all the expressions in the array. The $and operator uses short-circuit evaluation. If the first expression (e.g. <expression1>) evaluates to false, MongoDB will not evaluate the remaining expressions.
func (*Query) In ¶
In The $in operator selects the documents where the value of a field equals any value in the specified array
func (Query) NOR ¶
NOR $nor performs a logical NOR operation on an array of one or more query expression and selects the documents that fail all the query expressions in the array.
func (Query) NOT ¶
NOT $not performs a logical NOT operation on the specified <operator-expression> and selects the documents that do not match the <operator-expression>. This includes documents that do not contain the field.
func (*Query) Nin ¶
Nin selects the documents where: the field value is not in the specified array or the field does not exist.