Open jafaripur opened 1 year ago
@jafaripur Thank you for your improvement. This is clearly a good change. However, let's explore all possibilities and perhaps make this function even better. As far as I know, the different values for an attribute are possible. Here is my suggestion on handling them all:
Value | Action |
---|---|
A null value | Cast to integer and make it 0, then update |
A "number" value | Update normally |
A non-number value | Raise exception |
An array with a single value | Look at the single value and act accordingly. Preserve the array, so with a +1 increment, [123] becomes [124] , not 124 |
An array with multiple values | Raise exception |
If possible, the exception should be meaningful, so it should be obvious that we are updating a value that can not be updated.
When using
updateAllCounters
for a field which is missed or is null get exception error fromElasticSearch
:This behavior should cast null and missed field to
0
.