YDN-DB - Incorrect results using mixed data types with SortedMerge

拈花ヽ惹草 提交于 2019-11-28 02:23:19

From what I can see from you code, column 'd' should be INTEGER, or query should use date like:

ydn.db.KeyRange.bound(toDate(1389571200000),toDate(1390435200000), false, false)

EDIT:

Sorry, key joining algorithm only work for equi-join. Range will not work. You can use one range query however, but require six compound index [a, d], [b, d], [c, d], d, [e, d], [f, d] and join using ZigZeg merge. Detail here http://dev.yathit.com/ydn-db/nosql-query.html You can also find requirement for equi join.

Current ZigZeg is faster then SortedMerge since IndexedDB API spec 1 does not have require methods. However v2 is coming with require methods, namely openKeyCursor and continuePrimaryKey. Result of ZigZeg is sorted by d, whereas SortedMerge is sorted by primary key.

Instead of storing a Date object, store the timestamp representation instead:

var timestamp = new Date().getTime();

Since a timestamp is an integer, you can then effectively use a key range on it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!