Can't delete tags after bootstrap

Hi guys,

I’m trying to remove all tags applied to a CPE after factory reset (bootstrap) with this script applied to ‘0 BOOSTRAP’ event:

const now = Date.now();

//Remove Tags
clear("Tags.*", null, {value: false});

//Clear path tree
clear("DeviceID", now);
clear("Events", now);
//clear("FactoryReset", now);
clear("InternetGatewayDevice", now);

But doesn’t work. After factory reset, tags still applied to CPE. I also was try to remove one by one in the same script with same result as follows:

const now = Date.now();

//Remove Tags
clear("Tags.tag1", null, {value: false});
clear("Tags.tag2", null, {value: false});
clear("Tags.tagN", null, {value: false});

//Clear path tree
clear("DeviceID", now);
clear("Events", now);
//clear("FactoryReset", now);
clear("InternetGatewayDevice", now);

I’m doing anything wrong? There are another method to remove all tags?

Thanks!!

try with:

//Remove Tags
decare("Tags.tag1", null, {value: false});
decare("Tags.tag2", null, {value: false});
decare("Tags.tagN", null, {value: false});

the clear is just for invalidating the mongodb cache data.

1 Like

Hi lavira,

You’re right, i was have a mistake writing clear instead declare… This is because i was copy and paste from another provision script hehe.

Thank you so much!