Only the first ldb file of 3 is read

59 views Asked by At

When I open the database and read the contents, only the first ldb file is read. The rest remain untouched, although there is information there. using this library

db, err := leveldb.OpenFile("db/1", &opt.Options{ReadOnly: true})
  if err != nil {
    //error handling
  }
  var data []string

  iter := db.NewIterator(nil, nil)
  for iter.Next() {
    data = append(data, string(iter.Key()))
    data = append(data, string(iter.Value()))
  }

  iter.Release()
  err = iter.Error()
  fmt.Println(err)

  defer db.Close()

files: enter image description here

0

There are 0 answers