PurgeStreamEntries
Description
The stream entries of the stream Thing on which the service is called will be purged. If you want to purge the historical data of multiple streams, you can call this service on each stream Thing.
By default, the purge runs asynchronously.
Input
Parameter name
Description
Base Type
startDate
The start date, including the specified date, from which the historical data should be purged.
DATETIME
endDate
The end date, including the specified date, up to which the historical data should be purged.
DATETIME
immediate
If false, the purge runs asynchronously. The default value is false. You can set this value to true to purge synchronously.
BOOLEAN
Output
None.
Example
In the following example, TestStream has several entries which have been accumulating data over time. The following snippet can be used to purge its data from a specified time range.
// Params for purging stream entry data from the past year
var purgeStreamEntriesParams = {
startDate: new Date(new Date().setFullYear(new Date().getFullYear() - 1)), /* DATETIME */,
endDate: Date.now(), /* DATETIME */,
immediate: true /* BOOLEAN {"defaultValue":false} */
};

Things["TestStream"].PurgeStreamEntries(purgeStreamEntriesParams);
Was this helpful?