Support wildcard (*) in stache querybuilder where
queries
#7454
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.
One thing I find myself reaching for a lot, and that has also been asked for on Discord a few times, is the ability to query inside replicator type fields (indexed arrays) for a subfield value.
At the moment you can do the following:
Obviously this falls apart when you dont know the length of your replicator field, or becomes unwieldy when you have lots of items in your replicator as you have to write lots of orWheres()
The PR attempts to resolve this by supporting wildcard searches (*) in where queries.
So the query above would become:
As far as I can tell, compatibility with eloquent will not be possible for this feature, so it would be file-driver only.
You'll see from the code I've restricted this to arrays only, though you may want to widen the scope once you see it in action. I've also tried to accommodate multiple wildcards... eg