tencent cloud

Tencent Cloud Observability Platform

Item.delete

PDF
Focus Mode
Font Size
Last updated: 2025-03-11 19:41:14
Item.delete marks the data row represented by this Item as deleted, and it will not be used during the execution of the current script.
datele(): void

Return

Type
Description
void
No content returned.

Usage Examples

Mark a row of data in the parameter file as deleted:
import dataset from 'pts/dataset';

export function setup() {
// Traverse the parameter file named 'test.csv'.
dataset.forEach('test.csv', (item) => {
// If the data value of the key 'key1' in the data row item is '1', mark it as deleted, and it will not be used during the execution of this script.
if (item.data.key1 === '1') {
item.delete();
}
});
}

export default function() {
// The data rows with 'key1' column having a value of '1' will not be accessed during the script execution.
const record = dataset.random('test.csv');
console.log(JSON.stringify(record));
}


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback