gungundb

What is the desired behaviour of gun.map() on root node?


The result of using:

var gun = Gun({ peers: ['http://something/gun'] });
gun.map(()=>{})
// or
gun.map().on(()=>{})

in gun 0.2020.430 is writing to localStorage the names of the (root?!) nodes prefixed with undefined.

Because of the prefix, I suppose it is a bug, but the result should be without the prefix or nothing at all?

I suppose, nothing at all would be a better option, because it would prevent possible rough behaviors, like overwriting all the data... but?


Solution

  • Currently, it is intended to do nothing.

    In the future, I'd be cool to support it mapping over EVERYTHING, but that is obviously a very resource/time-consume thing to do, and probably a bad idea.