Querying JSONField in Django

If you are a Django developer and have to deal with kinds of data where you don’t know the datatype or the number of values to store, your best bet is to go with JSONField.

You get JSONField if you are using Postgres.

When you don’t know the schema of the data that you need to store, the first thing that comes to mind is NOSQL. However, that means sacrificing the comforts of SQL and ForeignKey for many (I personally am happy with both).

Using JSONField makes it a little difficult to do filtering on the data in JSONField.

Continue reading “Querying JSONField in Django”