Change Type ID with merge/upsert


#1

Is it possible to change/update an existing instance ID?

Ex: SmartBulb.id = SMBLB1
I want to change it to SMBLB01 , keeping everything else the same?


#2

You can change the ID but a new object will be created, you will have to remove the old one.

var sm = SmartBulb.get('SMBLB1', 'this')
// create new one
sm.id = 'newID';
sm.merge() // or upsert()
// remove old one
SmartBulb.remove('SMBLB1')