code: func (cmd *BenchCommand) runWrites(db *bolt.DB, options *BenchOptions, results *BenchResults) error {
  	// Start profiling for writes.
  	if options.ProfileMode == "rw" || options.ProfileMode == "w" {
  		cmd.startProfiling(options)
  	}
  
  	t := time.Now()
  
  	var err error
  	switch options.WriteMode {
  	case "seq":
  		err = cmd.runWritesSequential(db, options, results)
  	case "rnd":
  		err = cmd.runWritesRandom(db, options, results)
  	case "seq-nest":
  		err = cmd.runWritesSequentialNested(db, options, results)
  	case "rnd-nest":
  		err = cmd.runWritesRandomNested(db, options, results)
  	default:
  		return fmt.Errorf("invalid write mode: %s", options.WriteMode)
  	}
  
  	// Save time to write.
  	results.WriteDuration = time.Since(t)
  
  	// Stop profiling for writes only.
  	if options.ProfileMode == "w" {
  		cmd.stopProfiling()
  	}
  
  	return err
  }
docs: // Writes to the database.