You are reading content from Scuttlebutt
User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
@Anders %C7ds+PuNIEwc+wzh/1sknYLNQf8KKy83YAPB/pQntDo=.sha256

Amazing! Do you mind if I link to this from dev.scuttlebutt.nz? It has a section on jitdb and db2.

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
@Anders %Vujri46S3kv36nnsD+TmiKHuzWw9sFK59yCZjS0jw+0=.sha256

@memo for mentions we have created a indexdb plugin that will index all the links. This means you can do something like:

db.query(
    and(mentions(feedId)),
    toCallback((err, results) => {
       // do it
    })
)

Example from the tests. You can also combine these kind of indexes with normal jitdb indexes like:

db.query(
  and(mentions(feedId), author(anotherfeedId)),
  toCallback((err, results) => {
       // do it  
  })
)

So all mentions of feedid by anotherfeedid.

@andrestaltz %5Hx9iLLoxxpIxOsIGEjnK1S9kfSzhJ+j5rHxzgg1gtM=.sha256

@memo besides the leveldb plugin that arj mentioned (he said indexdb but I think he meant leveldb), there's also the includes operator in jitdb that allows going through array items such as those in mentions.

See: https://github.com/ssb-ngi-pointer/ssb-db2/blob/5a3358ec47f30c87e0884b93fa883909c4231c1a/operators/index.js#L77-L82 and https://github.com/ssb-ngi-pointer/jitdb/blob/4f3104b685c47d9b529a8123405fd71d8fc098cf/test/operators.js#L1392

User has not chosen to be hosted publicly
@cel-desktop %roBWEl82yUu4JcGVD8zKBaeFNaMHd3TAqbvPu5/dHgI=.sha256

What I was trying to do was count all the posts grouped by hashtag, to see which hashtags were most popular. And I succeeded, but with the old database, it requires parsing every mention client side, with no way to filter or reduce. T

ssb-links indexes mentions (with ssb-db)

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
Join Scuttlebutt now