Skip to content

Conversation

fhassak
Copy link
Contributor

@fhassak fhassak commented Dec 21, 2017

thanks to @csarrazi who helped me for this contribution

@csarrazi
Copy link
Contributor

You’re welcome! 😉

*/
public class Variable<TExpression> {
private final String name;
private TExpression value;
Copy link
Contributor

Choose a reason for hiding this comment

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

missing final

Copy link
Collaborator

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

Looks great, just would like to use a few more tests of the first overload, as well as the javadoc fixes.

* @since 3.7
*
*/
public static Bson lookup(final String from, final List<? extends Bson> pipeline, final String as) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like to see a unit and functional test for this overload. Currently it's untested, but I want to make sure we catch any issues when let is null.

}

/**
* Creates a $lookup pipeline stage for the specified filter
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's fix this comment now, as there is no filter, but rather a pipeline. Perhaps:

Creates a $lookup pipeline stage, joining the current collection with the one specified in from using the given pipeline.

Copy link
Collaborator

Choose a reason for hiding this comment

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

(I realize the comment in the existing lookup method is misleading as well. Feel free to fix that one too if you're so inclined.)

* Creates a $lookup pipeline stage for the specified filter
*
* @param from the name of the collection in the same database to perform the join with.
* @param let specifies variables to use in the pipeline field stages.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Replace "specifies" with "the".

@fhassak
Copy link
Contributor Author

fhassak commented Dec 28, 2017

It's hard for me to know what's wrong because it works on my pc :

image

)

collection.insertDocuments(
Document.parse('''{ "_id" : 1, "student" : "Ann Aardvark",
Copy link
Collaborator

Choose a reason for hiding this comment

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

The build failure is due to trailing whitespace on this line. If you run `./gradlew driver-core:check' it should fail for you too.

@jyemin jyemin self-assigned this Jan 3, 2018
@jyemin jyemin merged commit 5efa133 into mongodb:master Jan 3, 2018
@jyemin
Copy link
Collaborator

jyemin commented Jan 3, 2018

Thanks for the work on this @fhassak! It's now merged to master.

antimony pushed a commit to antimony/mongo-java-driver that referenced this pull request Oct 1, 2018
JAVA-2715: Support lookup stage in Aggregates builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants