Home Manual Reference Source Test
import {Measurement} from 'influx/src/builder.js'
public class | source

Measurement

Measurement creates a reference to a particular measurement. You can reference it solely by its name, but you can also specify the retention policy and database it lives under.

Example:

m.name('my_measurement') // "my_measurement"
m.name('my_measurement').policy('one_day') // "one_day"."my_measurement"
m.name('my_measurement').policy('one_day').db('mydb') // "mydb"."one_day"."my_measurement"

Method Summary

Public Methods
public

db(db: *): *

Sets the database name.

public

name(name: *): *

Sets the measurement name.

public

policy(retentionPolicy: *): *

Sets the retention policy name.

public

toString(): *

Converts the measurement into its InfluxQL representation.

Public Methods

public db(db: *): * source

Sets the database name.

Params:

NameTypeAttributeDescription
db *

Return:

*

public name(name: *): * source

Sets the measurement name.

Params:

NameTypeAttributeDescription
name *

Return:

*

public policy(retentionPolicy: *): * source

Sets the retention policy name.

Params:

NameTypeAttributeDescription
retentionPolicy *

Return:

*

public toString(): * source

Converts the measurement into its InfluxQL representation.

Return:

*

Throw:

Error

if a measurement name is not provided