-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-4528: Extend Search.Equals to support number and date #1043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling correction and minor question. Overall looks good.
} | ||
|
||
[Fact] | ||
public void Equals_typed() | ||
public static object[][] EqualsSupporteddTypesTestData => new[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EqualsSupporteddTypesTestData => EqualsSupportedTypesTestData
(extra "d" in the middle)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.
long v => (BsonInt64)v, | ||
float v => (BsonDouble)v, | ||
double v => (BsonDouble)v, | ||
DateTime v => (BsonDateTime)v, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we support DateTimeOffset
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can. We don't have a direct implicit conversion to BsonDateTime
, so not sure how best to account for offset in this case.
Maybe we can consider support for DateTimeOffset
both for Equals
and Range
in a separate ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that BsonDateTime
stores the date in UTC, we can do something like this:
DateTimeOffset v => (BsonDateTime)v.UtcDateTime,
We would also need to add tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* CSHARP-4528: Extend Search.Equals to support number and date
…#1043) * CSHARP-4528: Extend Search.Equals to support number and date
No description provided.