Sorting on date issue

93 views
Skip to first unread message

Far

unread,
Feb 15, 2018, 4:34:04 AM2/15/18
to RavenDB - 2nd generation document database
Hi, 

I am experiencing issues when trying to sort a list of around 1500 items by date.
As The limit in raven queries is 1024 items, items from before the 10th of each month is left out of the list.
Thus if changes are made during the, let's say 5th of March, they will not appear in my results.

How can this be fixed?


Michael Yarichuk

unread,
Feb 15, 2018, 6:43:38 AM2/15/18
to RavenDB - 2nd generation document database
Hi,
What version are you using? Have you tried using streaming queries?

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards,

 

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Michael Yarichuk l RavenDB Core Team 

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 

RavenDB paving the way to "Data Made Simple"   http://ravendb.net/  

Oren Eini (Ayende Rahien)

unread,
Feb 15, 2018, 11:42:18 AM2/15/18
to ravendb
What kind of query are you running?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

On Thu, Feb 15, 2018 at 11:34 AM, Far <faraz....@gmail.com> wrote:

Far

unread,
Feb 20, 2018, 3:26:08 AM2/20/18
to RavenDB - 2nd generation document database
Hi,

I fixed the issue by ordering by etag instead of CreationDate. 


Thank you!



On Thursday, February 15, 2018 at 5:42:18 PM UTC+1, Oren Eini wrote:
What kind of query are you running?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Thu, Feb 15, 2018 at 11:34 AM, Far <faraz....@gmail.com> wrote:
Hi, 

I am experiencing issues when trying to sort a list of around 1500 items by date.
As The limit in raven queries is 1024 items, items from before the 10th of each month is left out of the list.
Thus if changes are made during the, let's say 5th of March, they will not appear in my results.

How can this be fixed?


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Far

unread,
Feb 20, 2018, 4:20:03 AM2/20/18
to RavenDB - 2nd generation document database
But as a note, since Raven does not sort CreationDate well, what can be done?

My query was .OrderByDescending(x => x.CreationDate)

Far

unread,
Feb 20, 2018, 5:00:24 AM2/20/18
to RavenDB - 2nd generation document database
raven 3.0 

Oren Eini (Ayende Rahien)

unread,
Feb 20, 2018, 5:01:27 AM2/20/18
to ravendb
What do you mean, does not sort well?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Far

unread,
Feb 20, 2018, 7:51:22 AM2/20/18
to RavenDB - 2nd generation document database
It did not sort it correctly, i.e. as expected, the most recent date was not the one the came out, but rather something from last year..

Oren Eini (Ayende Rahien)

unread,
Feb 20, 2018, 7:52:11 AM2/20/18
to ravendb
Can you show a repro?

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Far

unread,
Feb 20, 2018, 8:44:41 AM2/20/18
to RavenDB - 2nd generation document database
Attached an image to this post. That is the result I get when I try .OrderByDescending(x => x.CreationDate) 
However, I have file entries from yesterday, and even before and after the dates in the image. 
And in the other pages (this query is used for paging btw), 2018 dates are mixed with 2017, as It seems like is 
following months and dates with a strange pattern disregarding the year.

Full query:

var query = fileSession
                            .Query()
                            .WhereEquals(x => x.Directory, path)
                            .OrderByDescending(x => x.CreationDate)
                            .Skip(page * (PAGESIZE - 1))
                            .Take(PAGESIZE);
img1.JPG

Oren Eini (Ayende Rahien)

unread,
Feb 20, 2018, 9:35:10 AM2/20/18
to ravendb
There are not dates in RavenDB format.
The format is: 2018-02-20T16:34:07.3562694+02:00  

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Far

unread,
Feb 20, 2018, 11:34:08 AM2/20/18
to RavenDB - 2nd generation document database
My dates in raven are in the format you specified :) I showed you a snippet from the website

Oren Eini (Ayende Rahien)

unread,
Feb 21, 2018, 2:56:26 AM2/21/18
to ravendb
Run the query on the studio, what do you get?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Tue, Feb 20, 2018 at 6:34 PM, Far <faraz....@gmail.com> wrote:
My dates in raven are in the format you specified :) I showed you a snippet from the website

Far

unread,
Feb 21, 2018, 4:13:43 AM2/21/18
to RavenDB - 2nd generation document database
This is for RavenFS, so I cant run the query in the studio



On Wednesday, February 21, 2018 at 8:56:26 AM UTC+1, Oren Eini wrote:
Run the query on the studio, what do you get?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Tue, Feb 20, 2018 at 6:34 PM, Far <faraz....@gmail.com> wrote:
My dates in raven are in the format you specified :) I showed you a snippet from the website

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Feb 21, 2018, 4:15:15 AM2/21/18
to ravendb
Not following. Can you show the full query you are using?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Far

unread,
Feb 21, 2018, 4:21:55 AM2/21/18
to RavenDB - 2nd generation document database
There is no "sort by" in the file store in my raven studio.

Here's the query:

var query = fileSession
                            .Query()
                            .WhereEquals(x => x.Directory, path)
                            .OrderByDescending(x => x.CreationDate)
                            .Skip(page * (PAGESIZE - 1))
                            .Take(PAGESIZE);
- show quoted text - 

Oren Eini (Ayende Rahien)

unread,
Feb 21, 2018, 4:37:36 AM2/21/18
to ravendb
Can you check what OrderByDescending overload is being run? 
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Far

unread,
Feb 21, 2018, 4:43:44 AM2/21/18
to RavenDB - 2nd generation document database
This is the overload that is being run:

IAsyncFilesOrderedQuery<T> OrderByDescending<TValue>(params Expression<Func<T, TValue>>[] propertySelectors);

Oren Eini (Ayende Rahien)

unread,
Feb 21, 2018, 6:21:28 AM2/21/18
to ravendb
That is the right one. Can you try creating a failing test for this?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Far

unread,
Feb 26, 2018, 5:50:08 AM2/26/18
to RavenDB - 2nd generation document database
like a test where it fails? what do you mean?

Arkadiusz Palinski

unread,
Feb 26, 2018, 6:14:15 AM2/26/18
to rav...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages