-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-4938: Support for indexing and querying on UUID and null datatype #1563
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
new EqualsSearchDefinition<TDocument, TField>(path, value, score); | ||
|
||
/// <summary> | ||
/// Creates a search definition that queries for documents where an indexed field is equal | ||
/// to the specified value. | ||
/// Supported value types are boolean, numeric, ObjectId and date. | ||
/// Supported value types are null, boolean, numeric, ObjectId, Guid and date. |
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.
Need to add the Guid
comment also to In
operator?
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.
Definitely
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.
Just did
[BsonElement("testString")] | ||
public string TestString { get; set; } | ||
|
||
[BsonGuidRepresentation(GuidRepresentation.Standard)] |
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.
Remove the extra line.
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.
You mean to have both attributes on one line?
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.
Oh sorry it's all good, on the smaller laptop screen it seemed like there is an extra empty line.
@@ -302,12 +302,14 @@ public void Equals_should_render_supported_type<T>( | |||
new object[] { (double)1, "1", Exp(p => p.Double), nameof(Person.Double) }, | |||
new object[] { DateTime.MinValue, "ISODate(\"0001-01-01T00:00:00Z\")", Exp(p => p.Birthday), "dob" }, | |||
new object[] { DateTimeOffset.MaxValue, "ISODate(\"9999-12-31T23:59:59.999Z\")", Exp(p => p.DateTimeOffset), nameof(Person.DateTimeOffset) }, | |||
new object[] { ObjectId.Empty, "{ $oid: '000000000000000000000000' }", Exp(p => p.Id), "_id" } | |||
new object[] { ObjectId.Empty, "{ $oid: '000000000000000000000000' }", Exp(p => p.Id), "_id" }, | |||
new object[] { Guid.Empty, """{ "$binary" : { "base64" : "AAAAAAAAAAAAAAAAAAAAAA==", "subType" : "04" } }""", Exp(p => p.Guid), nameof(Person.Guid) }, |
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.
'Raw string literals', nice feature! TIL
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 except for one comment
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! + Last minor comment about to update the In doc.
[BsonElement("testString")] | ||
public string TestString { get; set; } | ||
|
||
[BsonGuidRepresentation(GuidRepresentation.Standard)] |
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.
Oh sorry it's all good, on the smaller laptop screen it seemed like there is an extra empty line.
@@ -122,13 +122,13 @@ public SearchDefinition<TDocument> Equals<TField>( | |||
FieldDefinition<TDocument, TField> path, | |||
TField value, | |||
SearchScoreDefinition<TDocument> score = null) | |||
where TField : struct, IComparable<TField> => | |||
where TField : IComparable<TField> => |
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.
Can we remove this IComparable constraint as well? Looking at the code path we don't do any comparing ourselves, we just render the value in the search stage. I actually don't see a benefit for us if we are not doing the comparing. I tried testing removing all the type constraints here, and everything still works and evergreen doesn't report any breaking changes. Thoughts? @BorisDog
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.
I agree that this can be removed safely and just did it.
Just added the test collections on the common cluster. Waiting for the CI to be green and then I'll merge |
No description provided.