Couchbase range query -
i have testa couchbase 4 server, store sensor measurement data.
i have following view:
function (doc, meta) { if (doc.aks) { emit([doc.aks, doc.timestamp], { value: doc.value, status: doc.status }); } } here example document:
{ "timestamp": 1199180981, "value": 0, "status": 2147483650, "aks": "bn028:h23:vs:001:zustand" } i try following query view: give me timerange of values single sensor.
/_view/timeline?stale=false&startkey=["bn020:h03:zw:102:mc_t_return",12675419334]&endkey=["bn020:h03:zw:102:mc_t_return",13675419334]
but give no result.
i result if jsut use startkey= or endkey= not if use both. wrong?
make sure have data in bucket fall within range. used view , query , received results. example document not within range, aks wrong , timestamp early. if add document in range should receive back. 1 lower bound of range:
{ "timestamp": 12675419334, "value": 0, "status": 2147483650, "aks": "bn020:h03:zw:102:mc_t_return" }
Comments
Post a Comment