const gun = Gun({
localStorage : false,
axe : false,
file : "test",
})
https://cdn.jsdelivr.net/gh/user/repo@version/file
anybody have a working gists of
This will grab keys with '2019/06/' matching prefix (grab all chats in July!) up to a limited number of bytes.
like in the docs ? https://gun.eco/docs/RAD#lex
2019/06/22:10:10:10.33
I don't how lex sorting on multiple : : : would work, that's not a date format imo
{
"2019/05/25:10:10:10.30": {
"#": "chat/2019/05/25:10:10:10.30"
},
"2019/05/21:10:10:10.30": {
"#": "chat/2019/05/21:10:10:10.30"
},
"2019/05/22:10:10:10.30": {
"#": "chat/2019/05/22:10:10:10.30"
},
"2019/05/23:10:10:10.30": {
"#": "chat/2019/05/23:10:10:10.30"
},
"2019/06/23:10:10:10.30": {
"#": "chat/2019/06/23:10:10:10.30"
},
"2019/06/21:10:10:10.30": {
"#": "chat/2019/06/21:10:10:10.30"
},
"2019/06/22:10:10:10.30": {
"#": "chat/2019/06/22:10:10:10.30"
},
"2019/06/24:10:10:10.30": {
"#": "chat/2019/06/24:10:10:10.30"
},
"2019/06/25:10:10:10.30": {
"#": "chat/2019/06/25:10:10:10.30"
},
"2019/06/20:10:10:10.30": {
"#": "chat/2019/06/20:10:10:10.30"
},
"2019/05": {
"#": "chat/2019/05"
}
}
gunHeroku.get('chat').get({'.': {'*': '2019/05'}, "%" : 5000}).map().once(s=>{
console.log (s); //This only fired once
})
is this an expected result ?
I note you have
2019/06/22:10:10:10.33
I don't how lex sorting on multiple : : : would work, that's not a date format imo
I copied it from the docs.
Hi guys, I've been playing around with Gun it the past few days. It's great :)
I have a few basic/conceptual questions I wasn't able to get with the docs though. I didn't want to bother you here so I opened it on StackOverflow if you want to have a look: stackOverflow link Hopefully I'm not the only one with such questions
@amark , the docs really need some big overhaul.
console.log("testing get {'.':{'>':'2021/06'} expecting 6 output")
var i = 1;
var raddy = gun.get(key).get({'.':{'>':'2021/06'},'%':50000}).map(data=>{
i++;
console.log("getter found data",data);
if(i==2) t.equal(data.stuff, "22", "expected result to be `22` correct")
if(i==3) t.equal(data.stuff, "23", "expected result to be `23` correct")
if(i==4) t.equal(data.stuff, "24", "expected result to be `24` correct")
if(i==5) t.equal(data.stuff, "25", "expected result to be `25` correct")
if(i==6) t.equal(data.stuff, "31 1.00", "expected result to be `31 1.00` correct")
if(i==7) t.equal(data.stuff, "31 1.30", "expected result to be `31 1.30` correct")
}).once();
t.end();