Support IN queries
See original GitHub issueLet’s say I have the following sample
data:
[
{ id: 1, value: 'something' },
{ id: 2, value: 'something' },
{ id: 3, value: 'something' },
{ id: 4, value: 'something' },
{ id: 5, value: 'something' },
{ id: 6, value: 'something' },
{ id: 7, value: 'something' },
{ id: 8, value: 'something' },
{ id: 9, value: 'something' },
{ id: 10, value: 'something' },
]
When I execute the following:
let filtered1 = sample.filtered('id > 5')
it returns one Results
object with 5 filtered values like this:
// value of filtered1 in console
Results {-1: undefined, Symbol(): 2, Symbol(): 8, Symbol(): "results"}
However, my question is how I can filter random ids? For example, I want to filter ids of 2, 4, 7, and 10. What I can think of is:
let filtered2 = [2,4,7,10].map( (id) => {
return sample.filtered('id == $0', id);
})
But the problem here is it returns an array of 4 Results
objects, not the single Results
object.
// value of filtered2 in console
[Results, Results, Results, Results]
Is it possible to get the results like the filtered1
in the second case?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:15 (5 by maintainers)
Top Results From Across the Web
supports - CSS: Cascading Style Sheets - MDN Web Docs
The @supports CSS at-rule lets you specify CSS declarations that depend on a browser's support for CSS features. Using this at-rule is ...
Read more >Support Query Definition - Law Insider
Support Query means your query for Technical Support via online form, e-mail or support phone line, filed by your Support Contacts or end...
Read more >Our Top 5 Support Queries and How to Solve Them - GlobalSign
Our round the world team are ready to help you during local work hours and make sure your questions are solved almost as...
Read more >Introduction to queries - Microsoft Support
A query can give you an answer to a simple question, perform calculations, combine data from different tables, add, change, or delete data...
Read more >How @supports Works | CSS-Tricks
For example, iOS shipped support for CSS grid in version 10.2, ... in an article called Using Feature Queries in CSS a few...
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
Here is a code snippet that should generate the query you want to run:
This should create a query of the form
id == 2 OR id == 4 OR id == 7 OR id ==10
. Once we supportIN
queries it will do this for you internally.Any update on IN operator?