Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 24 06:51
    expelledboy synchronize #1276
  • Nov 22 18:04
    BrendanDN commented #1290
  • Nov 22 18:04
    BrendanDN closed #1290
  • Nov 22 18:04
    BrendanDN commented #1290
  • Nov 22 17:59
    BrendanDN commented #1292
  • Nov 22 04:07
    ndaidong commented #1292
  • Nov 21 20:28
    verschmelzen opened #1293
  • Nov 21 19:44
    BrendanDN commented #1292
  • Nov 21 14:50
    ndaidong opened #1292
  • Nov 19 17:41
    estebanrfp commented #1080
  • Nov 18 21:26
    @rogowski banned @jesus:halogen.city
  • Nov 18 17:04
    yuetloo commented #1290
  • Nov 17 07:42
    expelledboy synchronize #1276
  • Nov 17 04:11
    ViteOrder opened #1291
  • Nov 16 21:00
    BrendanDN opened #1290
  • Nov 16 19:41
    sbrow commented #1238
  • Nov 14 14:04
    weirdo-neutrino commented #1265
  • Nov 13 11:28
    KrzysztofZawisla edited #1289
  • Nov 13 11:19
    KrzysztofZawisla opened #1289
  • Nov 11 23:56
    nsreed synchronize #1275
Jachen Duschletta
@Dletta
[D]lupin: Progress for Lone Wolf using the protocol I have been working on and solidjs + tailwind for the messaging application
[D]lupin:
Connor Davis
@connor-davis
Jachen Duschletta
@Dletta
[D]KMac (i001962): Gun-Manhattan on Heroku has used its free dynos for the month. Expect weirdness if peering with it.
Wasis Haryo Sasoko
@yokowasis
How to get the last 10 items on a set ? I know I have read it somewhere.
Wasis Haryo Sasoko
@yokowasis

what exactly does this do ?

gun.get({'#': 'chat', '.': '2019/06/20:10:10:10.30'}).once(s=>{
  console.log(s);
})

the doc said it's a lexical match but the output is totally the same with :

gun.get('chat').once(s=>{
  console.log(s);
})
Jachen Duschletta
@Dletta
[D]jabis: you need to use .map
[D]jabis: with the rad/lex query
[D]jabis: (for some reason)
Wasis Haryo Sasoko
@yokowasis

you mean

gun.get({'#': 'chat', '.': '2019/06/20:10:10:10.30'}).map().once(s=>{
  console.log(s);
})

like this ?

Jachen Duschletta
@Dletta
[D]jabis: yes
[D]jabis: not sure about the query, am on phone, check the docs
Wasis Haryo Sasoko
@yokowasis
yeah totally the same
it result the whole array
Jachen Duschletta
@Dletta
[D]jabis: gun.get('chat').get({'.': {'*': '2019/06/'}}).map().once((data)=>{ console.log("data is",data); })
Wasis Haryo Sasoko
@yokowasis
yeah that straight up didn't work.
Jachen Duschletta
@Dletta
[D]jabis: see note about what you need to include in order to use it in browser
Wasis Haryo Sasoko
@yokowasis
Yeah, i have been on that pages for hours. still can't get the code on the docs working. I straight up copy pasting it.
Jachen Duschletta
@Dletta
[D]jabis: if you want direct match you need to use '='
Wasis Haryo Sasoko
@yokowasis
    <script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/gun/sea.js"></script>    
    <script src="https://cdn.jsdelivr.net/npm/gun/lib/radix.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/gun/lib/radisk.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/gun/lib/store.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/gun/lib/rindexed.js"></script>    
    <script src="https://unpkg.com/peerjs@1.3.1/dist/peerjs.min.js"></script>
my include
Jachen Duschletta
@Dletta
[D]jabis: don't know which version of gun jsdelivr from npm uses
Wasis Haryo Sasoko
@yokowasis
you mean
gun.get({'#': 'chat', '.' = '2019/06/20:10:10:10.30'}).once(s=>{
  console.log(s);
})
Jachen Duschletta
@Dletta
[D]jabis: no
Wasis Haryo Sasoko
@yokowasis
gun.get({'#': 'chat', '=' : '2019/06/20:10:10:10.30'}).once(s=>{
  console.log(s);
})
?
Jachen Duschletta
@Dletta
[D]jabis: {'.': {'>': 'dave', '<': 'fred'}, '%': 50000} , so it would be .get('chat').get({'.':{'=':'2019/06/20:10:10:10.30'}})
[D]jabis: also include the byte percentage for hit
[D]jabis: and you NEED to use map with all rad queries
[D]jabis: without map in there it won't trigger the lex portion at all
Wasis Haryo Sasoko
@yokowasis

tried

gun.get('chat').get({'.':{'=':'2019/06/20:10:10:10.30'}}).map().once(s=>{
  console.log(s);
})

straight up doesn't work. the callback didn't get called.

I didn't know whether this is a gun bug, or just mistakes on the docs.
Jabis Sevon
@jabis
image.png
probably your gun version
might have a bug there
(note I'm using my browser's location.host +'-testing' as "sandbox" for these random debuggings, to not put unnamespaced testing stuff to the root :)
Wasis Haryo Sasoko
@yokowasis
@jabis , are you doing put before running the script ? can you try running the script without putting it in the same command ?
Jabis Sevon
@jabis
gun.get(window.location.host+'-testing').get('chat').get('2021/06/31').put({stuff:'this is shown'}).once(Gun.log)
and
gun.get(window.location.host+'-testing').get('chat').get('2021/05/31').put({stuff:'this is hidden'}).once(Gun.log)
so you see I pulled records '>':'2021/06'
and only the "this is shown" was shown
without map it returned the both
gun.get(window.location.host+'-testing').get('chat').get({'.':{'>':'2021/06'},'%':50000}).map().once(Gun.log)
you can drop the first get out
leave the rest (well modify the timestamp)
Wasis Haryo Sasoko
@yokowasis
yap, doesn't work on me.
Jabis Sevon
@jabis
I used 2021/05 and 2021/06 vs your 2019/06 whatevs :)
image.png
also tested the '=' operator and it matches