Monday, 22 February 2021

Django get min and max value from PostgreSQL specific ArrayField holding IntegerField(s)

I have an ArrayField in my model holding IntegerFields. I'm looking for the best way in which I can extract the smallest and the biggest integer out of this array.

The Django documentation doesn't give examples of something similar and I wonder if the right way would be finding out how and if I can use aggregation function on this ArrayField or if I can cast this to normal python list of integers somehow and use the build in min, max functions?

Any suggestions for performing this would be helpful. Examples even more.



from Django get min and max value from PostgreSQL specific ArrayField holding IntegerField(s)

No comments:

Post a Comment