-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitwise.go
35 lines (30 loc) · 1.19 KB
/
bitwise.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
package query
// https://docs.mongodb.com/manual/reference/operator/query-bitwise/
// BitsAllClear matches documents where all of the bit positions
// given by the query are clear (i.e. 0) in field.
// New in version 3.2.
// https://docs.mongodb.com/manual/reference/operator/query/bitsAllClear/
func BitsAllClear(mask interface{}) M {
return M{"$bitsAllClear": mask}
}
// BitsAllSet matches documents where all of the bit positions
// given by the query are set (i.e. 1) in field.
// New in version 3.2.
// https://docs.mongodb.com/manual/reference/operator/query/bitsAllSet/
func BitsAllSet(mask interface{}) M {
return M{"$bitsAllSet": mask}
}
// BitsAnyClear matches documents where all of the bit positions
// given by the query are clear (i.e. 0) in field.
// New in version 3.2.
// https://docs.mongodb.com/manual/reference/operator/query/bitsAllClear/
func BitsAnyClear(mask interface{}) M {
return M{"$bitsAnyClear": mask}
}
// BitsAnySet matches documents where any of the bit positions
// given by the query are set (i.e. 1) in field.
// New in version 3.2.
// https://docs.mongodb.com/manual/reference/operator/query/bitsAllSet/
func BitsAnySet(mask interface{}) M {
return M{"$bitsAnySet": mask}
}