Is There a JSONSET Operator in the Core?

TiddlyWIki has a jsonget operator, so you can retrieve values of a JSON object its value is an object (nested object).
Why there is NOT a jsonset operator? A one level nesting can give us a plenty of flexibilities.

Is there any solution for this? I know we have a great json - mangler plugin.

Workaround by @EricShulman How to iterate on a dictionary (and an array) from a json data tiddler? - Discussion - Talk TW (tiddlywiki.org)

It cannot create the nested object but allows you to toggle the current values.

A more complete solution by @telumire How to iterate on a dictionary (and an array) from a json data tiddler? - #4 by telumire

Still these are not jsonset ::cry:

I do plan to add facilities to write/modify JSON, but wanted to make sure that the new JSON retrieval operators are correct first.

A jsonset operator could use multiple operands to specify the indexes of the item to be inserted, with the final operand being the value to be inserted. For example, this would be roughly equivalent to the JavaScript assignment mydata.photos[index] = value:

[<mydata>jsonset[photos],<index>,<value>]

We’d also need a similar operator that inserts fragments of JSON, rather than just simple strings.

1 Like

Hi @jeremyruston
Thank you for clarification! Yes, the jsonset seems more complex.