How to get out filter ready categories/buckets
See original GitHub issue@fergiemcdowall and @mewwts ! A JavaScript question from the semi illiterate. I’m looping and looping through a search result set to grab what I need for filtering. It seems it should be a better way. An example of what I have is this:
{
"categories": [
{
"key": "ingredients",
"value": [
{
"key": "sukker",
"value": 365
},
{
"key": "egg",
"value": 291
},
{
"key": "hvetemel",
"value": 261
},
{
"key": "bakepulver",
"value": 198
},
{
"key": "smør",
"value": 198
}
]
}
]
}
And what I want from it is this:
[
{
"field": "ingredients",
"gte": "sukker",
"lte": "sukker"
},
{
"field": "ingredients",
"gte": "egg",
"lte": "egg"
},
{
"field": "ingredients",
"gte": "hvetemel",
"lte": "hvetemel"
},
{
"field": "ingredients",
"gte": "bakepulver",
"lte": "bakepulver"
},
{
"field": "ingredients",
"gte": "smør",
"lte": "smør"
}
]
How is this best/simplest done? I’m doing this in the browser, and looking to browserify it later, so I would like to keep additional libraries out of it.
It’s for the norce-vuejs-app
, so I need it to be general, working without knowing what the field is going to be.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Guide to writing output filters - Apache HTTP Server Version 2.5
Output filters must be prepared to process buckets of non-standard types; with a few exceptions, a filter need not care about the types...
Read more >Categorize Dimension Column Values into Buckets
In CRM Analytics, use a bucket column in a Data Prep recipe to categorize and organize text values. For example, you can create...
Read more >Filtering catalog by non-anchor category throws "Bucket does ...
In the left column, click on the "Category" filter; Click on "Hoodies & Sweatshirts" to filter by it. Let me know if I...
Read more >What is Bucket Field in Salesforce? Create and ... - Intellipaat
Step 4: Go to the left-aligned menu and click on the arrow near Columns and select 'Add Bucket Field' and double-click it. You...
Read more >Bucketing in Looker - Google Cloud
You can enable or disable dimension fill by hovering over the dimension name in the Explore, clicking the field-level gear icon, and selecting...
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
No, I’m googling my eyes sore here, and hard when not knowing what to search for 😃 I’ll check that out! And thanks for the example, @meewts 👍
Sorry, got it working, @mewwts. “Move along! nothing to see here.”