@@ -82,38 +82,50 @@ func (c cmdable) bitOp(ctx context.Context, op, destKey string, keys ...string)
82
82
return cmd
83
83
}
84
84
85
+ // BitOpAnd creates a new bitmap in which users are members of all given bitmaps
85
86
func (c cmdable ) BitOpAnd (ctx context.Context , destKey string , keys ... string ) * IntCmd {
86
87
return c .bitOp (ctx , "and" , destKey , keys ... )
87
88
}
88
89
90
+ // BitOpOr creates a new bitmap in which users are member of at least one given bitmap
89
91
func (c cmdable ) BitOpOr (ctx context.Context , destKey string , keys ... string ) * IntCmd {
90
92
return c .bitOp (ctx , "or" , destKey , keys ... )
91
93
}
92
94
95
+ // BitOpXor creates a new bitmap in which users are the result of XORing all given bitmaps
93
96
func (c cmdable ) BitOpXor (ctx context.Context , destKey string , keys ... string ) * IntCmd {
94
97
return c .bitOp (ctx , "xor" , destKey , keys ... )
95
98
}
96
99
100
+ // BitOpNot creates a new bitmap in which users are not members of a given bitmap
101
+ func (c cmdable ) BitOpNot (ctx context.Context , destKey string , key string ) * IntCmd {
102
+ return c .bitOp (ctx , "not" , destKey , key )
103
+ }
104
+
105
+ // BitOpDiff creates a new bitmap in which users are members of bitmap X but not of any of bitmaps Y1, Y2, …
106
+ // Introduced with Redis 8.2
97
107
func (c cmdable ) BitOpDiff (ctx context.Context , destKey string , keys ... string ) * IntCmd {
98
108
return c .bitOp (ctx , "diff" , destKey , keys ... )
99
109
}
100
110
111
+ // BitOpDiff1 creates a new bitmap in which users are members of one or more of bitmaps Y1, Y2, … but not members of bitmap X
112
+ // Introduced with Redis 8.2
101
113
func (c cmdable ) BitOpDiff1 (ctx context.Context , destKey string , keys ... string ) * IntCmd {
102
114
return c .bitOp (ctx , "diff1" , destKey , keys ... )
103
115
}
104
116
117
+ // BitOpAndOr creates a new bitmap in which users are members of bitmap X and also members of one or more of bitmaps Y1, Y2, …
118
+ // Introduced with Redis 8.2
105
119
func (c cmdable ) BitOpAndOr (ctx context.Context , destKey string , keys ... string ) * IntCmd {
106
120
return c .bitOp (ctx , "andor" , destKey , keys ... )
107
121
}
108
122
123
+ // BitOpOne creates a new bitmap in which users are members of exactly one of the given bitmaps
124
+ // Introduced with Redis 8.2
109
125
func (c cmdable ) BitOpOne (ctx context.Context , destKey string , keys ... string ) * IntCmd {
110
126
return c .bitOp (ctx , "one" , destKey , keys ... )
111
127
}
112
128
113
- func (c cmdable ) BitOpNot (ctx context.Context , destKey string , key string ) * IntCmd {
114
- return c .bitOp (ctx , "not" , destKey , key )
115
- }
116
-
117
129
// BitPos is an API before Redis version 7.0, cmd: bitpos key bit start end
118
130
// if you need the `byte | bit` parameter, please use `BitPosSpan`.
119
131
func (c cmdable ) BitPos (ctx context.Context , key string , bit int64 , pos ... int64 ) * IntCmd {
0 commit comments