我怎样才能分组并更改沙发床中的值的内容? [英] How can I groupBy and change content of the value in couchbase?
问题描述
解释:
我得到这样的结果
发射后的结果1:
键-------------------------------值
Key-------------------------------value
"2014/10/31" ----------------- {"A":a}
"2014/10/31" ----------------- {"A":a}
"2014/10/31" ----------------- {"B":b}
"2014/10/31" ----------------- {"B":b}
"2014/10/31" ----------------- {"C":c}
"2014/10/31"----------------- {"C":c}
"2014/10/31" ----------------- {"D":d}
"2014/10/31"----------------- {"D":d}
如何输出上一个的新结果:
How can I output this new result from the previous one:
键-------------------------值
Key-------------------------value
"2014/10/31" ----------------- {"Array":["A":a,"B":b,"C":c ,"D":d]}
"2014/10/31" -----------------{"Array":["A":a, "B":b, "C":c, "D":d]}
有办法吗?任何帮助将不胜感激.谢谢
Is there a way? Any help will be appreciated. Thanks
推荐答案
我找到了它.只需执行以下操作即可:在路径中使用group = true或从过滤器结果中选择它. 以及一个reduce函数,用于从地图中返回所有值.您还可以添加开始键="2014/10/31"和结束键="2014/10/31".
I found it . Just do : group = true in the path or select it from the filter result . and a reduce function to return all the values from the map. also you can add the start key = "2014/10/31" and end key= "2014/10/31".
这篇关于我怎样才能分组并更改沙发床中的值的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!