var $gk = {};
$gk[Gun.time.is()] = objectData;
user.get('notes').get('category').put($gk)
[D]anoxy: <@280426612900757504> by re-init do you mean: get back the node data ?
<@612728945313316904> so in other words, if I put null on a node for ie in my case if I do null on category
by get('category')
then only the node itself gets nulled, any other data or keyNodes which belongs to that node will still be present in the root right ?
data
and nodeKeys
which belongs to a node
m
put(someData)
in a node which has been nulled
?
put(someData)
in anulled
node.
[D]anoxy: How is that done in a smooth way ?
And yeah null only deletes the references I got that part, but why cannot I add new references to the nulled node ? This can be seen here
https://jsbin.com/rorezebaho/edit?html,js,console,output
Create a user and login, add some categories, and then delete the node. And try to add new categories. It just doesn't work. <@280426612900757504> sent some code to make it works but I think it should still be possible to give new references to a nulled node with put
var testing = null
and do testing.something = "hello"
it fails
[D]anoxy: <@280426612900757504> thanks for giving me a solution as well.
But now to my question if I want to delete all data and keys belonging to a node .
In my case it is :user.get('notes').get('category')
Where it's "data" has the structure:
{Gun.time.is():
{name: 'some text', prop2: 'some other text'},
Gun.time.is():
{name: 'some text', prop2: 'some other text'}
}
[D]keymaker91: <@!178314946201780224> Thank you for the elaborate response. I understand your thought process, your ideas and the way you are pushing gun forward. Kudos to you for building such an amazing community and having such wonderful rhetorics.
GitHub counts comments/feedback as contributions. For the sake of great ideas behind gun, I hope you are counting them as well.
I have nothing else to contribute
[D]anoxy: Can someone please tell me how I can hard delete a whole node and its related data?
RIght now I can only do "softDelete", I need to know how I can "hardDelete" or make the references nulled/empty without the keys being left somewhere, is this even possible?
result = user.get('notes').get('category').get(nodeKey).once(async function(data, key){
console.log('data', data);
console.log('key', key);
this.put({}, async function(ack){
console.log('ack ', ack);
if (ack.ok !== 1)
throw "nodeKey could not be softDeleted! Reason: " + ack.err;
return ack;
});
});