Nested matching appears to be broken
See original GitHub issueI just wanted to start by saying thanks again for a great lib!
I’ve been trying to upgrade the sift dependency for mson from version sift 9.0.0. Unfortunately, I’m seeing a number of issues. I dug into a particular problem and am seeing an issue with matching nested queries, e.g. the following filter doesn’t capture any values with sift v13.1.10. It does however work with sift v9.0.0:
import sift from "sift";
const where = {
fields: {
firstName: {
value: {
$eq: "Jimmy"
}
}
}
};
const whereProps = {
fields: {
firstName: {
value: "Jimmy"
}
}
};
const sifted = [whereProps].filter(sift(where));
console.log({ sifted });
Here’s a codesandbox for it not working in v13.1.10. And one for it working in v9.0.0
I haven’t had a chance yet to identify a root cause yet.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Nested Yara matching doesn't work - yr_scanner seems to be ...
New scanner API in libyara (>=3.8.0) generates "segmentation fault" when additional scanning is executed from the callback.
Read more >Nested vs flattened pattern match in Scala - Stack Overflow
While the nested version avoids duplicate typing, it can lead to hard-to-read code due to indentation overflow when n is high (and we...
Read more >My filter suggestions are broken for nested data in Big Query ...
The recommended strategy for handling nested fields in BigQuery is to create separate views for the nested fields and join them to the...
Read more >Broken links when using nested shared components from ...
Hi! I created this very complex workflow that includes many nested shared components. I am a big fan of relative paths for that...
Read more >How to correct a #N/A error in INDEX/MATCH functions
SOLUTION: To remove unexpected characters or hidden spaces, use the CLEAN or TRIM function, respectively. Also, verify if the cells are formatted as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, I think I follow now. Here you can see that the nesting does not work, but the dot notation does work.
For GitHub, here are the details of the mongoplayground that illustrates that nested searching doesn’t work in MongoDB:
Configuration:
Query:
=> The Query doesn’t return any results
Thanks for the help!
Sorry for the confusion here – MongoDB in this case is treating
$eq
has a prop. Here’s a better example: https://mongoplayground.net/p/0UIcUQl8Z3v