In our app we have very large datasets since the user wants to see the chart for the last 3 months (IoT device measurements). However, query errors after like 15 seconds (postgres says unexpected eof, connection terminated etc.).
What is the preferred way for such results and what are the limits?
Another question I am curious is; why did you prefer to store query results as json text instead of individual records in collections so that they can be iterated over? This would also enable to iterate over the cursor while creating the query results so you wont need to fetch everything in memory.