conscious-sapphire
conscious-sapphire3y ago

How to modify the dataset

I want to modify the dataset, remove all old data and save a modified version of the data as json. Doing await Dataset.pushData(myModifiedData) will add the data but doesnt remove old data
4 Replies
conscious-sapphire
conscious-sapphireOP3y ago
I tried this
await Dataset.drop()
await Dataset.drop()
but I get TypeError: Dataset.drop is not a function
HonzaS
HonzaS3y ago
you can try:
const dataset = await Dataset.open();
await dataset.drop();
const dataset = await Dataset.open();
await dataset.drop();
ambitious-aqua
ambitious-aqua3y ago
yeah, you should .drop() a specific instance, so what Honza says. Keep in mind though - that if you do it on the platform - you will delete dataset entirely - so you would need to open another one before pushing data to it. Dataset is read-only/append-only storage
HonzaS
HonzaS3y ago
and also keep in mind that the new one will have different id

Did you find this page helpful?