You are reading content from Scuttlebutt
@mix %RnopRCAYV/0n5bSxydbzV7esaSeDEC51oMk7KkWwyK8=.sha256
Re: %qfzxnC6Mo

hey @Hendrik Peter : TL;DR is use ssb-backlinks for votes + take into account unlikes!

Use ssb-backlinks for likes - it's the jam. Basically lets you ask "yo what's everything that referenced this thing here?". You can also tell it to ask for votes I think. Try it out and post up your query so we can compare notes !

Also, make sure you pull not just the person, but the time they posted it (or order by this), and the content.vote.value - this is generally +1 (or absent) for like, and -1 for "undo that like". The spec around this isn't really well written AT ALL, but you need to be able to make sure people can like + unlike things.


Things to know about ssb-query:

  • the query magically checks against some indexes which have been set up in ssb-query:
    • your query only partially matches an index, it's likely been unable to find a good match and fallen back to scrolling through the whole db...
    • here are the indexes
      • you could fix this with a $filter match on :
        { value: { content: { type: 'vote' }, timestamp: { $gt: 0 } } }
    • here's some sketches of how flumeview-query works : %QnST4gi... (it's built on flumeview-level ... the stack deepens!)
    • what you need to
  • if you are moving a lot of data over the ssb-client connection, but through it away as you reduce some state, then it's quicker to do the reduction on the server-side, inside a ssb-server plugin
    • your case isn't quite that yet, but if you find yourself doing heavy reducing you may want to go this way
Join Scuttlebutt now