Query all records from - filter
Hello,
I have a table with a JSON field that on some records is empty. When using the above query method I want to filter out all the records with that JSON field empty.
However differently then the filter list that appears usually in this case I can not find the is_empty filter. Comparing the JSON to empty object did not work as well.
How should I go about this?
Thanks.
Answers
-
Unless your JSON field is nullable, this is a tough one to filter on in the query - and it's never going to be indexable. If you don't want to change the table structure, I would just pull the data in the query and then filter it in the function stack subsequent.
-
Thanks Ray.
"nullable JSON" is that an attribute of the DB field?
Since I am pulling out only the last created record its more of an issue to query downwards at the function stack. I could have pulled the full list and then make additional memory query but its somewhat cumbersome.
So maybe I can go for the nullable option?
-
When you edit a field type, you will see a yes/no switch for "nullable." This lets you check whether the field in question is null. Applies to all sorts of types - can be a handy way to keep track of unset fields.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback