Files: 3ab10d83371e7fb6a97e4b0a23ded460ab8e01de / poll / pull / open.js
532 bytesRaw
1 | var next = require('pull-next-query') |
2 | |
3 | module.exports = function (server) { |
4 | return function AllPollsStream (opts) { |
5 | const defaultOpts = { |
6 | limit: 100, |
7 | query: [{ |
8 | $filter: { |
9 | value: { |
10 | timestamp: { $gt: 0 }, // this forces ssb query to stream in order of message published timestamp. |
11 | content: { |
12 | type: 'poll' |
13 | } |
14 | } |
15 | } |
16 | }] |
17 | } |
18 | const _opts = Object.assign({}, defaultOpts, opts) |
19 | |
20 | return next(server.query.read, _opts) |
21 | } |
22 | } |
23 |
Built with git-ssb-web