Details
-
Bug
-
Resolution: Works as Designed
-
Blocker - P1
-
None
-
2.4.4
-
None
-
None
-
Windows 10 connecting to mongod version: 3.4.5 (WiredTiger) | SSL mode: preferSSL hosted at Mongo Labs
Description
I am surprised to see that ordering by date is not working properly no matter what I try on the latest C# driver. Pretty sure this was working before.
Here are some examples where dates are not ordered properly and coming out of sequence:
|
|
var row = mongoCollection.AsQueryable<EntityClass>()
|
.OrderBy(p => p.MyDateTime.Value)
|
.OrderBy(p => p.OtherId)
|
.Where(p => p.MyId == myData.MyId)
|
.FirstOrDefault();
|
|
|
var row = (from p in mongoCollection.AsQueryable<EntityClass>()
|
where p.MyId == myData.MyId
|
orderby p.MyDateTime.Value ascending
|
orderby p.OtherId ascending
|
select p).FirstOrDefault();
|
|
|
row = (from p in mongoCollection.AsQueryable<EntityClass>()
|
where p.MyId == myData.MyId &&
|
p.OtherId > row.OtherId
|
orderby p.MyDateTime.Value ascending
|
orderby p.OtherId ascending
|
select p).FirstOrDefault();
|
|
None of these work. I get dates out of sequence as shown in the attachment. I even tried adding an index on the date column in the server - made no difference.