Having read this article today, Denormalization with JSON Fields for a Performance Boost, I got to wondering how to something like an F() expression to avoid race conditions might work to prevent having to increment a value in Python instead of the DB as the example shown in the post’s Book.save()
method.
It seems that F()
expressions do not work here so is there a way to have these kinds of operations done in the DB level inside of a JSONField without using F()
expressions?
Thanks.
Edit: One person’s method for doing this: Django’s JSONField incrementation with F expressions