Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:30
    bmatusiak commented #1240
  • 13:13
    bmatusiak commented #1240
  • 13:13
    bmatusiak commented #1240
  • 13:11
    bmatusiak commented #1240
  • 13:10
    bmatusiak commented #1240
  • 13:08
    bmatusiak commented #1240
  • 13:05
    bmatusiak commented #1240
  • 13:03
    bmatusiak commented #1240
  • 12:42
    mmalmi updated the wiki
  • May 24 21:08

    amark on master

    webpack example (#1240) (compare)

  • May 24 21:08
    amark closed #1240
  • May 24 21:08
    amark commented #1240
  • May 24 21:07
    ShaunSHamilton opened #1241
  • May 24 16:33
    scenaristeur commented #808
  • May 24 16:32
    scenaristeur commented #808
  • May 24 16:24
    bmatusiak opened #1240
  • May 24 02:57
    bmatusiak commented #1239
  • May 24 02:42
    bmatusiak opened #1239
  • May 24 00:14

    amark on master

    prepare to sync gun lib unbuild… (compare)

  • May 24 00:14
    amark closed #1237
Wasis Haryo Sasoko
@yokowasis
now another problem arise. Instead of grabbing matching criteria, it only grab 1.

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

Jabis Sevon
@jabis
image.png
Wasis Haryo Sasoko
@yokowasis
Now that I look at it, why '2019/06' is called july
@jabis can you return more than 1 matching results ?
let's say you have a chat from may to june. and you want to return june only
Jabis Sevon
@jabis
@yokowasis https://pastebin.com/H76i6Mzc here's my test script
it's a copy of my other SEA debugging script on node, I created test/ directory inside gun-folder and save that file there and run in the same directory
ie node test2.js in this case
wait I'll add a third result that's in 06 too
Jabis Sevon
@jabis
image.png
Wasis Haryo Sasoko
@yokowasis
@jabis thanks
Jabis Sevon
@jabis
@yokowasis there we go, 2 results as expected
https://pastebin.com/cx5s0Xnj here the updated one
Wasis Haryo Sasoko
@yokowasis
I think it's a bug. LEX/RAD able to get the result, but for some reason, it didn't fire the callback. The result is there, it's just the callback is not fired. But when you put something on the node, all of pending callback is get fired at once. @amark does this sound familiar to you ? maybe you heard a bug about the callback not get fired ?
Freddie
@Fredaroo_twitter
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
Wasis Haryo Sasoko
@yokowasis
@jabis the reason it's get called only once before, is because I still have your data of 2019/06/22 I put more data something like 2019/06/22:10:10:10.30 2019/06/22:10:10:10.33, etc. it only read your data. the lex is {'.': {'*': '2019/06/22'}, "%" : 5000}
Jabis Sevon
@jabis
is 5000 bytes too low
50000bytes is max
Wasis Haryo Sasoko
@yokowasis
but when i change the lexical to {'.': {'*': '2019/06/22:'}, "%" : 5000} it results multiple of my data
5KB is still a lot for just hello world node.
Jabis Sevon
@jabis
yeah true
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
Wasis Haryo Sasoko
@yokowasis
can you try my finding :
put something like 2019/06, 2019/06/21, 2019/06/22, 2019/06/23, 2019/06/24
here is my complete data
{
  "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.

Wasis Haryo Sasoko
@yokowasis

from the docs :

* prefix match or (2 <) match. If {'*': 'key'} is specified, (2 >) will not match.

what do (2<) and (2>) means ?

Jabis Sevon
@jabis
image.png
image.png
values I was expecting :)
Wasis Haryo Sasoko
@yokowasis

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.

@jabis what's the query ?
Jabis Sevon
@jabis
you can see it in the first snip
Lorenzo Mangani @qxip
@lmangani:matrix.org
[m]
GUN is opensource, improving docs is a perfectly valid way to contribute back ;)
Jabis Sevon
@jabis
@yokowasis
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();
Wasis Haryo Sasoko
@yokowasis

GUN is opensource, improving docs is a perfectly valid way to contribute back ;)

How can I contribute ? is there a github repo for the docs ?

2 replies
Jabis Sevon
@jabis
it's in lexicographically correct order here
Wasis Haryo Sasoko
@yokowasis
@jabis can you send me your data object ?
Jabis Sevon
@jabis
result7 {
 _: {
    '#': 'chat',
    '>': {
      '2021/05/31': 1632566761209,
      '2021/06/22 01:00:00': 1632566761312,
      '2021/06/23 01:30:00': 1632566761313.002,
      '2021/06/24 01:00:00': 1632566761314.001,
      '2021/06/25 01:30:00': 1632566761315,
      '2021/06/31 01:00:00': 1632566761315.004,
      '2021/06/31 01:30:00': 1632566761315.008
    }
  },
  '2021/05/31': { '#': 'chat.102jvom' },
  '2021/06/22 01:00:00': { '#': 'chat.-ipfkim' },
  '2021/06/23 01:30:00': { '#': 'chat.-oi86lk' },
  '2021/06/24 01:00:00': { '#': 'chat.-ug9s0o' },
  '2021/06/25 01:30:00': { '#': 'chat.-1492e3m' },
  '2021/06/31 01:00:00': { '#': 'chat.1tg6rqc' },
  '2021/06/31 01:30:00': { '#': 'chat.1tirdef' }
}
Tested also with prefix
testing get {'.':{'*':'2021/06'} expecting 6 output
mapfn Map functions are experimental, their behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it.
getter found data {
  _: { '#': 'chat.-ipfkim', '>': { stuff: 1632566761312 } },
  stuff: '22'
}
ok 1 expected result to be `22` correct
getter found data {
  _: { '#': 'chat.-oi86lk', '>': { stuff: 1632566761313.002 } },
  stuff: '23'
}
ok 2 expected result to be `23` correct
getter found data {
  _: { '#': 'chat.-ug9s0o', '>': { stuff: 1632566761314.001 } },
  stuff: '24'
}
ok 3 expected result to be `24` correct
getter found data {
  _: { '#': 'chat.-1492e3m', '>': { stuff: 1632566761315 } },
  stuff: '25'
}
ok 4 expected result to be `25` correct
getter found data {
  _: { '#': 'chat.1tg6rqc', '>': { stuff: 1632566761315.004 } },
  stuff: '31 1.00'
}
ok 5 expected result to be `31 1.00` correct
getter found data {
  _: { '#': 'chat.1tirdef', '>': { stuff: 1632566761315.008 } },
  stuff: '31 1.30'
}
ok 6 expected result to be `31 1.30` correct
valonce Chainable val is experimental, its behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it.
# force test to end
ok 7 forcing test to end with process.exit

1..7
# tests 7
# pass  7

# ok
this time set up else also which should've failed if there was extra data
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") 
    } else if(i==3) { t.equal(data.stuff, "23", "expected result to be `23` correct")
    } else if(i==4) { t.equal(data.stuff, "24", "expected result to be `24` correct")
    } else if(i==5) { t.equal(data.stuff, "25", "expected result to be `25` correct")
    } else if(i==6) { t.equal(data.stuff, "31 1.00", "expected result to be `31 1.00` correct")
    } else if(i==7) { t.equal(data.stuff, "31 1.30", "expected result to be `31 1.30` correct")
    } else { t.equal(data.stuff, "we shouldn't be here"); }
  }).once();
Adam Bowman
@abow
anyone else see certify() break when updating gun from 0.2020.1234 to 0.2020.1235 ?
1 reply
Jabis Sevon
@jabis
also dropped the bytes to 5000 same results
Wasis Haryo Sasoko
@yokowasis
@jabis I mean your json data.

here is my complete data

{
  "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"
  }
}

like this

Jabis Sevon
@jabis
I pasted it already above
'2021/05/31': { '#': 'chat.102jvom' },
'2021/06/22 01:00:00': { '#': 'chat.-ipfkim' },
'2021/06/23 01:30:00': { '#': 'chat.-oi86lk' },
'2021/06/24 01:00:00': { '#': 'chat.-ug9s0o' },
'2021/06/25 01:30:00': { '#': 'chat.-1492e3m' },
'2021/06/31 01:00:00': { '#': 'chat.1tg6rqc' },
'2021/06/31 01:30:00': { '#': 'chat.1tirdef' }
Wasis Haryo Sasoko
@yokowasis
@jabis can you add one more data with key 2021/06
and try to rerun your test > : 2021/06
and * : 2021/06