Query all records from - filter

Options

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.

Tagged:

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    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.

  • udigolan
    udigolan Member
    Options

    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?

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    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.