minor edits

pull/945/head
kelseiv 2020-08-17 21:15:31 -07:00 committed by GitHub
parent 79a274e5ed
commit 12bc92e654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ If just getting started, see [Get started with InfluxDB](/v2.0/get-started/).
## Easiest way to get started ## Easiest way to get started
1. Clone the [examples directory](https://github.com/influxdata/influxdb-client-js/tree/master/examples) in the [influxdb-client-js](https://github.com/influxdata/influxdb-client-js) repo. 1. Clone the [examples directory](https://github.com/influxdata/influxdb-client-js/tree/master/examples) in the [influxdb-client-js](https://github.com/influxdata/influxdb-client-js) repo.
2. Navigate to `examples` directory and install dependencies. 2. Navigate to the `examples` directory and install dependencies.
{{< code-tabs-wrapper >}} {{< code-tabs-wrapper >}}
{{% code-tabs %}} {{% code-tabs %}}
@ -59,7 +59,7 @@ yarn install
npm run browser npm run browser
``` ```
## Boilerplate for the InfluxDB Javascript Client Library ## Boilerplate for the InfluxDB Javascript client library
Use the Javascript library to write data to and query data from InfluxDB. Use the Javascript library to write data to and query data from InfluxDB.
To write a data point to InfluxDB using the JavaScript library, import the latest InfluxDB Javascript library in your script. To write a data point to InfluxDB using the JavaScript library, import the latest InfluxDB Javascript library in your script.
@ -68,7 +68,7 @@ To write a data point to InfluxDB using the JavaScript library, import the lates
import {InfluxDB, Point} from 'https://unpkg.com/@influxdata/influxdb-client/dist/index.browser.mjs' import {InfluxDB, Point} from 'https://unpkg.com/@influxdata/influxdb-client/dist/index.browser.mjs'
``` ```
Next, define constants for your InfluxDB [bucket](/v2.0/organizations/buckets/), [organization](/v2.0/organizations/), [token](/v2.0/security/tokens/), and `proxy` which relies on a proxy to forward requests to the target InfluxDB instance. Next, define constants for your InfluxDB [bucket](/v2.0/organizations/buckets/), [organization](/v2.0/organizations/), [token](/v2.0/security/tokens/), and `proxy` which relies on a proxy to forward requests to the target InfluxDB instance.
```js ```js
@ -78,7 +78,7 @@ const org = 'example-org'
const bucket = 'example-bucket' const bucket = 'example-bucket'
``` ```
Instantiate the InfluxDB JavaScript Client and pass in the`proxy` and `token` parameters. Instantiate the InfluxDB JavaScript client and pass in the `proxy` and `token` parameters.
```js ```js
const InfluxDB = new InfluxDB({proxy, token}) const InfluxDB = new InfluxDB({proxy, token})
@ -168,7 +168,7 @@ queryApi.queryRows(fluxQuery, {
const o = tableMeta.toObject(row) const o = tableMeta.toObject(row)
// console.log(JSON.stringify(o, null, 2)) // console.log(JSON.stringify(o, null, 2))
console.log( console.log(
`${o._time} ${o._measurement} in '${o.location}' (${o.example}): ${o._field}=${o._value}` '${o._time} ${o._measurement} in '${o.location}' (${o.example}): ${o._field}=${o._value}`
) )
}, },
error(error: Error) { error(error: Error) {