Details
Description
The following query:
def query_by_timestamp(timestamp: int) -> Query:
q = Query()
q.stale = STALE_UPDATE_BEFORE
q.startkey = timestamp
q.endkey = int(timestamp + QUERY_PERIOD)
q.inclusive_end = False
return q
-
- query_by_timestamp()
being called by:
def by_timestamp(cb: Connection, timestamp: int) -> View:
q = query_by_timestamp(timestamp)
q.reduce = False
view = cb.query("sensitive", "by_timestamp", include_docs=True, query=q, streaming=1)
return view
-
- by_timestamp()
The timestamp is a traditional Unix timestamp, i.e. it is a number key and not a string key. When `streaming` is set to `0` and not `1`, the query operates properly by returning the expected documents. (I pass `0` and `1` instead of True or False because the documentation says it is a bool and not a boolean.)
Anon,
Andrew