Changes between Initial Version and Version 7 of Ticket #36139
- Timestamp:
- Feb 4, 2025, 11:08:12 AM (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36139
- Property Has patch set
- Property Owner set to
- Property Status new → closed
- Property Resolution → wontfix
-
Ticket #36139 – Description
initial v7 1 In working towards supporting `ABSENT ON NULL` for JSONArray, I did some digging on what it would take to implement it for `JSONObject` as well, and essentially, because the __init__ signature consumes all the `kwargs`, there's not really a good way to configure its behavior without conflicting with a key definition.1 Currently there is no way to build a JSON object in the database using the JSONObject function where the keys are anything but static keys. 2 2 3 If you could specify the items of a JSONObject positionally, then you get the aforementioned benefit of being able to have kwargs as well without conflicting, but you also get the added benefit of being able to construct objects with non-static keys. 3 This is not a limitation of any of the backends that support JSON objects. 4 4 5 As an example esoteric usage, if you're trying to get the database to omit valid objects for the Elasticsearch DSL, you would almost certainly need to be able to build objects with non-static keys. 5 If you could specify the items of a JSONObject positionally, you get the benefit of being able to construct objects with non-static keys. 6 7 As an example esoteric usage, if you're trying to get the database to emit valid objects for the Elasticsearch DSL, you would almost certainly need to be able to build objects with non-static keys. 6 8 7 9 For example https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html