No description, website, or topics provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
.gitignore
.npmrc
.travis.yml
LICENSE
README.md
examples.md
index.js
package.json

README.md

ssb-query

A scuttlebot plugin which implements a flumeview-query index for the scuttlebutt context. ssb-query simply used flumeview-qurey to use map-filter-reduce querys on ssb data.

from the command line:

get the last 10 type=post messages

sbot query.read --query '[{"$filter": {"value": {"content": {"type": "post"}}}}]' --limit 10 --reverse

notice the json is inside single quotes ''

or, from inside javascript:

pull(
  sbot.query.read({
    query: [
      {$filter: {
        value: { content: { type: 'post' } }
      }}
    ],
    limit: 10, reverse: true
  })
  pull.collect(function (err, ary) {
    console.log(ary)
  })
)

Documentation of query operators available at map-filter-reduce The if the query has an index available, it will be fast, otherwise it will fall back to a full scan. Learn more about indexes and how they work at flumeview-query

See index.js for the current list of indexes offered by ssb-query.

License

MIT