-
Notifications
You must be signed in to change notification settings - Fork 0
/
comparison.go
51 lines (42 loc) · 1.54 KB
/
comparison.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package query
// https://docs.mongodb.com/manual/reference/operator/query-comparison/
// Eq matches values that are equal to a specified value.
// https://docs.mongodb.com/manual/reference/operator/query/eq
func Eq(value interface{}) M {
return M{"$eq": value}
}
// Gt matches values that are greater than a specified value.
// https://docs.mongodb.com/manual/reference/operator/query/gt
func Gt(value interface{}) M {
return M{"$gt": value}
}
// Gte matches values that are greater than or equal to a specified value.
// https://docs.mongodb.com/manual/reference/operator/query/gte/
func Gte(value interface{}) M {
return M{"$gte": value}
}
// In matches any of the values specified in an array.
// https://docs.mongodb.com/manual/reference/operator/query/in/
func In(value interface{}) M {
return M{"$in": value}
}
// Lt matches values that are less than a specified value.
// https://docs.mongodb.com/manual/reference/operator/query/lt/
func Lt(value interface{}) M {
return M{"$lt": value}
}
// Lte matches values that are less than or equal to a specified value.
// https://docs.mongodb.com/manual/reference/operator/query/lte/
func Lte(value interface{}) M {
return M{"$lte": value}
}
// Ne matches all values that are not equal to a specified value.
// https://docs.mongodb.com/manual/reference/operator/query/ne/
func Ne(value interface{}) M {
return M{"$ne": value}
}
// Nin matches none of the values specified in an array.
// https://docs.mongodb.com/manual/reference/operator/query/nin/
func Nin(value interface{}) M {
return M{"$nin": value}
}