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

Handle deep nested relations. Forbid 2 fully identical stages. #12

Merged
merged 4 commits into from
Mar 14, 2020

Conversation

DavidKrpt
Copy link
Contributor

  1. Fixed the buildLookup function to carry forward not just the current and the parent relations, but all of the ancestor relation names. Now $unwind and $lookup paths should be built correctly for 3 level and deeper nested relations.
  2. Before appending a stage perform a lodash deep equality to see if an identical stage already exists, if so, ignore the stage. Without this fix partially overlapping relation paths would result in multiple identical lookup and unwind stages for the overlapping parts of their paths, and each subsequent stage would overwrite the result of the previous one.

This PR doesn't address any of the remaining 2 issues, these are new.

@Akeri Akeri merged commit 2a75023 into aliatech:develop Mar 14, 2020
@Akeri
Copy link
Member

Akeri commented Mar 14, 2020

Very grateful for your contribution!
Published 1.1.3

@DavidKrpt DavidKrpt deleted the deep-nested-relations branch April 1, 2020 18:19
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.

None yet

2 participants