douzuita7325 2015-04-28 17:18
浏览 46

如何减少Couchbase上的查看呼叫?

Now I have a pretty big set of analytics , each in it's own document . I run a map/reduce that reduces them to a aggregated set like this :

Takes a start key and end key (time start and time end) and returns the following

 {"apps":{"unknown":6,"Samsung Gear":2},"countries":{"united states":6,"canada":1,"Mexico":1},"ratings":2,"rates":3,"total_count":8}}

Now the problem is say I was to get data for 7 days after each other . If I provide a Start (7days ago) and (today) I get one aggregated array - so I am forced to query 7 times , with the start and end of each day. Is there any better way to construct the map reduce ?

  • 写回答

1条回答 默认 最新

  • douqian2957 2015-04-28 18:15
    关注

    You may be able to use range queries ( provide startKey / endKey ) if you want to select a range of dates, if you are storing time stamps as unix time for example.

    http://docs.couchbase.com/admin/admin/Views/views-querying.html

    评论

报告相同问题?

悬赏问题

  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条