You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ds/ts/add-mod-del.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
To add new samples to a time series, use the `TS.ADD` and `TS.MADD` commands. Note that if the series does not exist, it will be automatically created.
4
4
5
-
```redis Add data points to a time series
5
+
```redis:[run_confirmation=true] Add data points to a time series
6
6
TS.ADD // adds a new data point
7
7
bike_sales_1 // new key name
8
8
1000 // timestamp, simplified for these examples
@@ -29,7 +29,7 @@ TS.MGET FILTER region=east // returns the last sample from all time series with
29
29
30
30
You can also add to or update an existing time series using the `TS.ADD` command.
31
31
32
-
```redis Update a time series sample
32
+
```redis:[run_confirmation=true] Update a time series sample
33
33
TS.ADD // use TS.ADD to update an existing sample
34
34
bike_sales_1 // key name for the time series you would like to update
35
35
1000 // existing timestamp
@@ -39,7 +39,7 @@ TS.ADD // use TS.ADD to update an existing sample
39
39
40
40
To delete samples, specify the interval (inclusive) between two timestamps for a given time series.
41
41
42
-
```redis Delete
42
+
```redis:[run_confirmation=true] Delete
43
43
TS.DEL bike_sales_1 999 1000 // deletes all the data points between two timestamps (inclusive)
44
44
45
45
TS.DEL bike_sales_2 1000 1000 // to delete a single timestamp, use it as both the "from" and the "to" timestamp
@@ -49,12 +49,12 @@ TS.DEL bike_sales_2 1000 1000 // to delete a single timestamp, use it as both th
49
49
50
50
Increase (`TS.INCRBY`) or decrease (`TS.DECRBY`) the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given increment.
51
51
52
-
```redis TS.INCRBY example
52
+
```redis:[run_confirmation=true] TS.INCRBY example
53
53
TS.INCRBY bike_sales_3 1 // increases the latest sample by one to 173
54
54
TS.GET bike_sales_3
55
55
```
56
56
57
-
```redis TS.DECRBY example
57
+
```redis:[run_confirmation=true] TS.DECRBY example
58
58
TS.DECRBY bike_sales_3 1 // decreases the latest sample by one to 172
59
59
TS.GET bike_sales_3
60
60
```
@@ -63,4 +63,4 @@ See the `TS.INCRBY` and `TS.DECRBY` command pages for more information about the
63
63
64
64
### Delete time series
65
65
66
-
Use the `DEL` command to delete one or more time series.
66
+
Use the `DEL` command to delete one or more time series.
0 commit comments