I was trying to check on a way to query entire json field data in PostgreSQL. But, all I see is querying for a specific field like below.
# SAMPLE DATA
# data = {"test": 1, "test_another": 2}
select * from sample_table where data->>'test' = ('1')
The above condition yields the correct result. But, I have tried querying on the entire block in multiple ways, but, it dosent seem to work and returns below error.
select * from sample_table where data->'{"test": 1, "test_another": 2}'
#ERROR: argument of WHERE must be type boolean, not type json