1. `someData1 = {name: 'Title', tag: 'my tag'}`
2. `user.get('notes').get('category').get(nodeKey).put(someData1)`
then I delete that data with:
3. `user.get('notes').get('category').get(nodeKey).put(null)`
the `nodeKey` will still be there, but if I choose to delete the `nodeKey` itself by using
4. `user.get('notes').get('category').put(null)`
is all the data belonging to that nodeKey also delete?
Lets assume that I delete the `nodeKey`, and later on I add some data to the same nodeKey:
5. `someData2 = {describe: 'Some description', where: 'here :) '}`
6. `user.get('notes').get('category').get(nodeKey).put(someData2)`
will anything from the old data (`someData1`) be shown after step `6` ?
In other words will the `name` and `tag` words still be there even though I deleted it according to step `3`?
// add object with multiple keys
user.get("notes").get(key).put({ name, tag })
// delete single key/value from object
let document;
user.get("notes").get(key).once(data => (document = data))
delete document["tags"]
user.get("notes").get(key).put(null).put(document)
[D]anoxy: basically I add data to a node with:user.get('notes').get('category').get(Gun.time.is()).put(objectData);
and I delete all the data with:user.get('notes').get('category').put(null);
this works without any problems.... BUT I cannot add more data to that node again after setting it to null
so if I do this again:user.get('notes').get('category').get(Gun.time.is()).put(objectData);
the data isnt added at all even though I cannot see the result of the object in the Console
user.get('notes').get('category').put(null);
doesnt work
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 ?
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