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 '[{"$filter": {"value": {"content": {"type": "post"}}}}]' --limit 10 --reverse

notice the json is inside single quotes ''

or, from inside javascript:

    query: [
      {$filter: {
        value: { content: { type: 'post' } }
    limit: 10, reverse: true
  pull.collect(function (err, 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.



results matching ""

    No results matching ""