

ncat - Concatenates table items together into a string table.foreach - Applies a function to each item in a table table.foreachi - Applies a function to each item in a numerically-keyed table table.getn - Returns the size of a numerically-keyed table table.maxn - Returns the highest numeric key in the table table.remove - Removes an item from a numerically-keyed table tn - Sets the size of a table (obsolete) table.sort - Sorts a table strings) you simply assign to the table item to insert it.

The Lua authors recommend using the idiom "#t + 1" to insert to the end of a table nowadays.

Table.insert (t, "jumped") - add to end of table Table.insert (t, 2, "very") - new element 2 If called with 2 arguments, the value is inserted at n+1, that is, the end of the table. Thus the new element becomes the one with index 'pos'. Inserts the value at (optional) position 'pos', renumbering existing elements if necessary to make room. More friendly to be distributed across many Redis instances.Īn example sampling the temperature of a sensor using fixed-size strings (usingĪ binary format is better in real implementations).Inserts a new item into a numerically-keyed table

Samples per key, to avoid dealing with very big keys, and to make this pattern Time, in this way it is possible to have just a relatively small amount of Hint: it is possible to switch to a different key based on the current Unix However the space efficiency of time series stored in this way is remarkable. Of operation, there is no way to cut the time series to a given size easilyīecause Redis currently lacks a command able to trim string objects. The limitation of this pattern is that we are forced into an append-only mode
