I am having trouble checking when the jsonb column of my table is empty.
My column directions when empty has value "{}"
Tried the following
Model.where("directions != '{}'") <- brings all
Model.where("directions <@ '{}'") <- brings all
is there any other way that i am not aware of? Using postgresql 9.6
Model.where.not(directions: '{}')
Model.where.not("directions::text = ?", "{}")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With