Skip to content

Commit ea3ba8e

Browse files
authored
Update README.md
1 parent 67cb62b commit ea3ba8e

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

README.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,18 @@ 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+
}
5447
}
5548
```
5649

0 commit comments

Comments
 (0)