Skip to content

Commit 58880c3

Browse files
committed
Merge branch 'master' of git@github.com:RedisBloom/redisbloom-go.git
2 parents 4100c24 + d62f4c7 commit 58880c3

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,24 @@ package main
3232

3333
import (
3434
"fmt"
35-
RedisBloom "github.com/RedisBloom/redisbloom-go"
35+
redisbloom "github.com/RedisBloom/redisbloom-go"
3636
)
3737

3838
func main() {
3939
// Connect to localhost with no password
40-
var client = RedisBloom.NewClient("localhost:6379", "nohelp", nil)
41-
var keyname = "mytest"
42-
_, haveit := client.Info(keyname)
43-
if haveit != nil {
44-
client.CreateKeyWithOptions(keyname, RedisBloom.DefaultCreateOptions)
45-
client.CreateKeyWithOptions(keyname+"_avg", RedisBloom.DefaultCreateOptions)
46-
client.CreateRule(keyname, RedisBloom.AvgAggregation, 60, keyname+"_avg")
47-
}
48-
// Add sample with timestamp from server time and value 100
49-
// TS.ADD mytest * 100
50-
_, err := client.AddAutoTs(keyname, 100)
51-
if err != nil {
52-
fmt.Println("Error:", err)
53-
}
40+
var client = redisbloom.NewClient("localhost:6379", "nohelp", nil)
41+
42+
// TS.ADD mytest item
43+
_, err := client.Add("mytest", "myItem")
44+
if err != nil {
45+
fmt.Println("Error:", err)
46+
}
47+
48+
exists, err = client.Exists("mytest", "myItem")
49+
if err != nil {
50+
fmt.Println("Error:", err)
51+
}
52+
fmt.Println("myItem exists in mytest: ", exists)
5453
}
5554
```
5655

0 commit comments

Comments
 (0)