Skip to content

Commit 2de8ed9

Browse files
author
Enric Sala
committed
Update README to show how to customize write requests
1 parent f517699 commit 2de8ed9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Create an InfluxDB client instance and use it to interact with the server:
3232
HOST = 'http://localhost:8086';
3333
USER = 'user';
3434
PASS = 'password';
35-
DATABASE = 'testing';
35+
DATABASE = 'server_stats';
3636
influxdb = InfluxDB(HOST, USER, PASS, DATABASE);
3737
3838
% Check if the InfluxDB server is running
@@ -42,7 +42,7 @@ influxdb = InfluxDB(HOST, USER, PASS, DATABASE);
4242
dbs = influxdb.databases()
4343
4444
% Change the current database
45-
influxdb.use('production');
45+
influxdb.use('weather_stations');
4646
```
4747

4848

@@ -89,6 +89,20 @@ influxdb.writer() ...
8989
.execute();
9090
```
9191

92+
The parameters of a write request can optionally be customized as follows:
93+
94+
```matlab
95+
% Customize a write request
96+
influxdb.writer() ...
97+
.database('another_database') ...
98+
.precision('ms') ...
99+
.retention('two_weeks') ...
100+
.consistency('quorum') ...
101+
.append(points, series) ...
102+
.execute();
103+
```
104+
105+
92106
Querying data
93107
-------------
94108

0 commit comments

Comments
 (0)