@@ -82,38 +82,50 @@ func (c cmdable) bitOp(ctx context.Context, op, destKey string, keys ...string)
8282 return cmd
8383}
8484
85+ // BitOpAnd creates a new bitmap in which users are members of all given bitmaps
8586func (c cmdable ) BitOpAnd (ctx context.Context , destKey string , keys ... string ) * IntCmd {
8687 return c .bitOp (ctx , "and" , destKey , keys ... )
8788}
8889
90+ // BitOpOr creates a new bitmap in which users are member of at least one given bitmap
8991func (c cmdable ) BitOpOr (ctx context.Context , destKey string , keys ... string ) * IntCmd {
9092 return c .bitOp (ctx , "or" , destKey , keys ... )
9193}
9294
95+ // BitOpXor creates a new bitmap in which users are the result of XORing all given bitmaps
9396func (c cmdable ) BitOpXor (ctx context.Context , destKey string , keys ... string ) * IntCmd {
9497 return c .bitOp (ctx , "xor" , destKey , keys ... )
9598}
9699
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
97107func (c cmdable ) BitOpDiff (ctx context.Context , destKey string , keys ... string ) * IntCmd {
98108 return c .bitOp (ctx , "diff" , destKey , keys ... )
99109}
100110
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
101113func (c cmdable ) BitOpDiff1 (ctx context.Context , destKey string , keys ... string ) * IntCmd {
102114 return c .bitOp (ctx , "diff1" , destKey , keys ... )
103115}
104116
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
105119func (c cmdable ) BitOpAndOr (ctx context.Context , destKey string , keys ... string ) * IntCmd {
106120 return c .bitOp (ctx , "andor" , destKey , keys ... )
107121}
108122
123+ // BitOpOne creates a new bitmap in which users are members of exactly one of the given bitmaps
124+ // Introduced with Redis 8.2
109125func (c cmdable ) BitOpOne (ctx context.Context , destKey string , keys ... string ) * IntCmd {
110126 return c .bitOp (ctx , "one" , destKey , keys ... )
111127}
112128
113- func (c cmdable ) BitOpNot (ctx context.Context , destKey string , key string ) * IntCmd {
114- return c .bitOp (ctx , "not" , destKey , key )
115- }
116-
117129// BitPos is an API before Redis version 7.0, cmd: bitpos key bit start end
118130// if you need the `byte | bit` parameter, please use `BitPosSpan`.
119131func (c cmdable ) BitPos (ctx context.Context , key string , bit int64 , pos ... int64 ) * IntCmd {
0 commit comments