Documentation

v1.databases() function

The v1.databases() function returns a list of databases in an InfluxDB 1.7+ instance.

import "influxdata/influxdb/v1"

v1.databases()

Output includes the following columns:

  • databaseName: Database name (string)
  • retentionPolicy: Retention policy name (string)
  • retentionPeriod: Retention period in nanoseconds (integer)
  • default: Default retention policy for database (boolean)

Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.