|
Parameter Name
|
Description
|
Base Type
|
|---|---|---|
|
propertyName
|
Name of the property for which historical data should be purged.
|
STRING
|
|
startDate
|
The start date, including the specified date, from which historical data should be purged.
|
DATETIME
|
|
endDate
|
The end date, including the specified date, up to which historical data should be purged.
|
DATETIME
|
|
immediate
|
If false, the purge runs asynchronously. The default value is false. If you set it to true, the purge will run synchronously.
|
BOOLEAN
|
// Purging historical data between the given start and end dates
Things["TestThing"].PurgePropertyHistory({
propertyName: 'propertyA-Logged' /* STRING */,
startDate: '2024-05-12T16:58:28.000Z' /* DATETIME */,
endDate: 'Date.now()' /* DATETIME */,
immediate: true /* BOOLEAN {"defaultValue":false} */
});
// Params for purging historical data from the past year
var purgeHistoryParams = {
propertyName: 'propertyA-Logged' /* STRING */,
startDate: new Date(new Date().setFullYear(new Date().getFullYear() - 1)),
endDate: Date.now(),
immediate: true /* BOOLEAN */
};
Things["TestThing"].PurgePropertyHistory(purgeHistoryParams);