Add nested relation filter limits - #1690
Closed
GiuseppeXD wants to merge 1 commit into
Closed
Conversation
Author
|
After discussing with the team, we decided to continue the block filter approach and create new routes for existing features |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description ✍️
Add a
limitcontrol to generated Graphoid filters so relation filtering can cap the related criteria before relation operators materialize matching documents.Overview 🔍
The limit is part of the filtered relation, not the parent query result:
*Filtertypes now acceptlimit: Int.Processor.executeremoves the control from normal predicates and applies it after building the criteria.belongs_tofiltering and filtering a selected to-many relation.Checks ☑️
git diff --checkpasses.Test Guidance
DRIVER=mongo bundle exec rspec spec/tester_mongo/spec/graphoid/queries/relations/belongs_to_spec.rb spec/tester_mongo/spec/graphoid/queries/relations/has_many_spec.rb.people(where: { account: { stringField_contains: "boc", limit: 1 } }); expect one matching parent record.labels(where: { name: "a", limit: 1 }); expect at most one selected related record per parent.limit: 0or a negative value through a relation filter; expect an invalid positive-limit error rather than an unbounded result.