79271210

Date: 2024-12-11 09:52:49
Score: 0.5
Natty:
Report link

With some help figured out a way to scan for all keys with required batch-count.

var cursor uint64 = 0
for {
     resss := client.Do(ctx, client.B().Scan().Cursor(cursor).Match("*").Count(2).Build())
     se, err := resss.AsScanEntry()
     if err != nil {
         fmt.Printf("client.Scan failed %v\n", err)
     }
     for _, sitem := range se.Elements {
         fmt.Printf("Scaned Item::: %v\n", sitem)
     }
     cursor = se.Cursor
     if cursor == 0 {
         break
     }
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Harish Reddy