tencent cloud

Tencent Cloud Observability Platform

Item.delete

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 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));
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백