Simple way to convert bytes to bits?

Just a newbie question. Cant understand what’s wrong with the code:

timeRange=-24h
apnDlStats =
from(bucket: "stat/autogen")
|> range(start: timeRange)
|> filter(fn: (r) =>
    r._measurement == "apnSch1" and
    r._field == "dnlnk-bytes" and
    r.node == "host1"
)
|> group(columns: ["apn"])
|> aggregateWindow(every: 5m, fn: sum) 
|> derivative(unit:5m,nonNegative:true)
|> map(fn: (r) => ({
        r._value: r._value * 8 / 300
      }))

apnDlStats

getting error:
Error: type error 0:0-0:0: invalid record access "_value": int!=float

in common i’m trying to make a flux analog of influx query like this:
SELECT non_negative_derivative(sum(“dnlnk-bytes”), 5m) *8/300 AS “bps”

Try

r._value: r._value * 8.0 / 300.0

timeRange=-24h
apnDlStats =
from(bucket: "stat/autogen")
|> range(start: timeRange)
|> filter(fn: (r) =>
    r._measurement == "apnSch1" and
    r._field == "dnlnk-bytes" and
    r.node == "nn-sae-1-1"
)
|> group(columns: ["apn"])
|> aggregateWindow(every: 5m, fn: sum) 
|> derivative(unit:5m,nonNegative:true)

apnDlStats
|> map(fn: (r) => ({
        r._value: r._value * 8.0 / 300.0
      }))

This does not work either. Now:
“Error: failed to evaluate map function: null reference used in row function: skipping evaluation until null support is provided”

I am out of my depth here but read:

What version of InfluxDB are you running? I’d suggest updating to 1.7.8 if you can. Null support is greatly improved in the version packaged with InfluxDB 1.7.8.

Exactly. Upgraded 1.7.7>1.7.8 yesterday and map started working.
Thank you)