CouchDB 排序 - 排序规范
排序规则规范
使用 CouchDB 视图,我的键似乎没有按照排序规则排序。
rows:
[0] key: ["bylatest", -1294536544000] value: 1
[1] key: ["bylatest", -1298817134000] value: 1
[2] key: ["bylatest", -1294505612000] value: 1
我预计第二个条目会在第三个条目之后出现。
为什么会发生这种情况?
Collation Specification
Using a CouchDB view it seems my keys aren't sorted as per the collation specification.
rows:
[0] key: ["bylatest", -1294536544000] value: 1
[1] key: ["bylatest", -1298817134000] value: 1
[2] key: ["bylatest", -1294505612000] value: 1
I would of expect the second entry to come after the third.
Why is this happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我得到了发出您指示的值的视图的结果。
这些行与您的示例中的两个都不同。它们通过以最小(最大负数)值开始并以最大值(在本例中为最小负数)结束来符合排序规范。
您是否可以包含您正在使用的文档和映射/归约功能?
I get this result for a view emitting the values you indicate.
The rows are different from both of your examples. They fit the collation specification by beginning with the smallest (greatest magnitude negative) value and ending with the greatest value (least magnitude negative in this case).
Would you perhaps include the documents and map/reduce functions you are using?