How to achieve iterating through wildcard enabled prefix?

What version of Go are you using (go version)?

$ go version
go version go1.17 linux/amd64

What operating system are you using?

Linux

What version of Badger are you using?

v3.2011.1

Steps to Reproduce the issue

prefix := "prefix"
for it.Seek([]byte(prefix)); it.ValidForPrefix([]byte(prefix)); it.Next() {

}

What Badger options were set?

itOpts := badger.DefaultIteratorOptions
itOpts.PrefetchSize = 20

What did you expect to see?

I’ve been listing the values from BadgerDB by seeking through a prefix. But I was wondering if wildcard is supported in the prefix.
Like I want iterate through prefix.*.suffix prefix. is it possible ?
If possible, then how am I supposed to do that ?

Another thing, suppose we have multiple values under a single key.
Is there a way to access a value from middle, based on the version of the value ? maybe through indexing instead of iterator ?

No, that’s not possible.

If you are using badger in managed mode, then you can create a transaction at some ts using NewTransactionAt. This will filter out all the keys that were written after that ts.