Files: 3ab10d83371e7fb6a97e4b0a23ded460ab8e01de / poll / pull / closed.js
594 bytesRaw
1 | var next = require('pull-next-query') |
2 | |
3 | module.exports = function (server) { |
4 | return function ClosedPollsStream (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 | closesAt: { $lt: new Date().toISOString() } |
14 | } |
15 | } |
16 | } |
17 | }] |
18 | } |
19 | const _opts = Object.assign({}, defaultOpts, opts) |
20 | |
21 | return next(server.query.read, _opts) |
22 | } |
23 | } |
24 |
Built with git-ssb-web