I figure it's about time I asked this question.
What is the most efficient way to modify a document tag's value?
The value itself is read in as a PyDocumentObjectAdapter object which doesn't appear to have any methods to manipulate the object data; no add, remove, or set methods.
What I have been using seems a bit over zealous, but at least it works. I use a script that's essentially similar to this Comparing Perspective Object - Never the same? - #2 by PGriffith which recursively converts all of the objects and their items into Py dicts and lists. For large documents though, this obviously isn't that efficient. You then also have to convert this back into JSON when you write it back to the tag. I've found instances where this doesn't work due to "maximum recursion depth reached" (despite only being 3-4 levels deep).
Is there a more direct way to do this and operate on the ObjectAdapter itself?