Descending(true) not working (maybe?)


#1

I have a view that has timestamps as keys in a UTC format, like “2016-08-18T23:14:54.584Z”. I’m using the java api to query the view:

ViewQuery.from("foo", "bar")
                .stale(Stale.UPDATE_AFTER)
                .limit(500)
                .includeDocs()
                .descending(true);

I assumed that specifying .descending(true) would result in the documents coming out in descending order of their key. But that’s not what’s happening. They are mostly in that order, but not quite. I printed them out to be sure:

2016-08-18T23:17:55.328Z
2016-08-18T16:43:02.220Z
2016-08-18T23:16:17.906Z
2016-08-17T22:00:22.864Z
2016-08-17T16:28:55.687Z
2016-08-17T14:32:23.514Z
2016-08-17T16:28:49.517Z
2016-08-17T14:26:32.203Z
2016-08-17T14:24:08.434Z
2016-08-17T14:23:29.877Z
2016-08-17T14:21:01.443Z
2016-08-18T23:14:54.584Z
2016-08-17T21:59:15.010Z
2016-08-17T14:32:41.434Z
2016-08-17T14:20:45.643Z
2016-08-17T14:26:15.898Z
2016-08-17T14:22:42.619Z
2016-08-17T06:52:25.074Z
2016-08-16T18:39:29.206Z
2016-08-16T18:31:20.151Z
2016-08-16T18:12:47.541Z
2016-08-16T18:29:40.419Z
2016-08-16T17:45:48.907Z
2016-08-16T16:51:12.543Z
2016-08-16T16:54:23.915Z
2016-08-16T16:50:47.578Z

Am I doing something wrong?


#2

Any idea on this, anyone?