javascriptnode.jspostgresqlpostgrest

PostgREST return not null values of JSON object


I have a postgrSQL table with three columns, one of which is a json field:

  id [num]  ||  school [char]   ||  info [json]
============================================================================
   1        ||   1st            || [{"fistname": "Bill", "Lastname": "Maison"}]
   2        ||   2nd            || [{"fistname": "John", "Lastname": "Handson"}]
   3        ||   3rd            || []
 

I want to filter the empty info fields with postgREST.

My url right now : https://127.0.0.1/table?&info->0->firstname=is.null

This actually returns all the values that are null, but how do I do it the other way? Exclude all the null values?


Solution

  • Found it. For anyone that will look this up in the future : https://127.0.0.1/table?&info->0->firstname=not.is.null