I have this query:
SELECT jsonb_agg(jsonb_build_object('me_id', me_id)) from message
and got the following result:
[{"me_id": 2064}, {"me_id": 2065}, {"me_id": 2066}, {"me_id": 2067}, {"me_id": 2068}, {"me_id": 2069}, {"me_id": 2070}, {"me_id": 2071}]
so far so good. However I want to LIMIT the amount of objects in the array. For instance to 3. But adding LIMIT 3 is not working.
How can I limit the amount of objects within the array?
EDIT: @GMB's answer solved it. Thank you!