Clamping subdocument counter operation

Hi, is there any way to clamp subdocument atomical operations to certain values?
For example let’s say I want to allow add and substract but make sure it doesn’t go below zero or above 100.
The documentation only talks of the format limit not of self imposed limits.

Hey @00christian00 ,

There is not currently a way to apply arbitrary clamping to the atomic operations we support. In some cases you could probably implement this by doing it at read-time, but this may not work in all circumstances.

Cheers, Brett