Documentation function

The function compares the lexicographical order of two strings.

Output data type: Integer

import "strings" "a", t: "b")

// returns -1

Return values

ComparisonReturn value
v < t-1
v == t0
v > t1



The string value to compare.

Data type: String


The string value to compare against.

Data type: String


Compare the lexicographical order of column values
import "strings"

  |> map(fn: (r) => ({
      r with
      _value: r.tag1, t: r.tag2)

Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: