code: func (n *node) AllByIndex(fieldName string, to interface{}, options ...func(*index.Options)) error {
  	if fieldName == "" {
  		return n.All(to, options...)
  	}
  
  	ref := reflect.ValueOf(to)
  
  	if ref.Kind() != reflect.Ptr || ref.Elem().Kind() != reflect.Slice {
  		return ErrSlicePtrNeeded
  	}
  
  	typ := reflect.Indirect(ref).Type().Elem()
  
  	if typ.Kind() == reflect.Ptr {
  		typ = typ.Elem()
  	}
  
  	newElem := reflect.New(typ)
  
  	cfg, err := extract(&newElem)
  	if err != nil {
  		return err
  	}
  
  	if cfg.ID.Name == fieldName {
  		return n.All(to, options...)
  	}
  
  	opts := index.NewOptions()
  	for _, fn := range options {
  		fn(opts)
  	}
  
  	return n.readTx(func(tx *bolt.Tx) error {
  		return n.allByIndex(tx, fieldName, cfg, &ref, opts)
  	})
  }
docs: // AllByIndex gets all the records of a bucket that are indexed in the specified index