Query JSONB fields in PostgreSQL
masterThe library supports querying PostgreSQL jsonb fields using dot notation to traverse the JSON structure. It utilizes the PostgreSQL jsonb_path_exists function under the hood.
Supported JSON primitive types:
- string
- number
- boolean
- array
Temporal Values: Since PostgreSQL 13, jsonb supports temporal values via the datetime() function. When querying date-time values stored in JSONB, you must use the ISO 8601 format. If the request conforms to a timezone pattern, the library will use jsonb_path_exists_tz.
// Example: querying a nested field in a jsonb column named 'data'
String rsql = "data.user.id==1";
List<User> users = userRepository.findAll(toSpecification(rsql));