djangonauts / django-pgjson

PostgreSQL json field support for Django
http://djangonauts.github.io/django-pgjson/
Other
131 stars 39 forks source link

Custom lookup support for jsonb @> containment op #4

Closed cpbotha closed 10 years ago

cpbotha commented 10 years ago

I've implemented a Django lookup to expose the special jsonb @> containment operator. You can read more about jsonb containment in the 9.4 docs: http://www.postgresql.org/docs/9.4/static/datatype-json.html -- in short, you can query on subsets of the jsonb you're looking for (I've documented this in the code). With a GiN index on the jsonb field, these queries are lightning fast.

I'm probably going to implement more of the jsonb operators as I need them for a project I'm working on.

niwinz commented 10 years ago

Nice! Thanks for your work!