Skip to content
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

CSHARP-1356: Fix Any workflow with Contains method. #13

Closed
wants to merge 1 commit into from

Conversation

DmitryLukyanov
Copy link
Owner

No description provided.

Copy link
Collaborator

@rstam rstam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See prelimary comment about what (not how) we are translating some of these LINQ expressions to.

Copy link

@craiggwilson craiggwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about the syntax for {$elemMatch: {$in: {}}. It obviously works, but why do we need $elemMatch in there at all?

@@ -163,8 +161,10 @@ private FilterDefinition<BsonDocument> TranslateAnd(BinaryExpression node)
return null;
}

private bool CanAnyBeRenderedWithoutElemMatch(Expression node)
private bool CanAnyBeRenderedWithoutElemMatch(Expression node, out bool doNotUseExpressionParamInQueryGeneration)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having booleans that are negated is always difficult to think about. I believe it would be better for this to be useExpressionParamInQueryGeneration instead.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will rename this param

@craiggwilson
Copy link

I amend my previous statement about the DocumentToFieldConverter... It is necessary and looks fine as it is.

@rstam
Copy link
Collaborator

rstam commented Jan 23, 2019

See proposed changes (with comments) here:

rstam#88

@DmitryLukyanov DmitryLukyanov force-pushed the CSHARP1356 branch 3 times, most recently from 3b1611f to b86f222 Compare January 24, 2019 18:00
Copy link
Collaborator

@rstam rstam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending one comment where I asked @craiggwilson to LGTM the removal of the VisitPipeline method in the DocumentToFieldConverter class.

protected internal override Expression VisitPipeline(PipelineExpression node)
{
return node;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@craiggwilson I would like you to LGTM that it is OK to remove this method.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, let's assume that I put it here for some reason (whatever that is). Is there any overriding reason to actually remove this other than "we don't know why it's here". If it's not causing issues, I don't see a reason to remove it just 'cause.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't remove it Dmitry's changes don't work.

So we should remove it, unless you can remember why you were suppressing visiting a PipelineExpression.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, if we have to remove it for things to work, then let's remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants