Increment an Integer Field by One

How can I increment an integer field in a table by one without first accessing that field, picking what is already in there, adding +1 and updating the record? Atomic counters was suggested, but am not sure how to implement this with that.

1 Like

Hello @Nkekere_Tommy_Minimann

You can find out how to use counters in the documentation: Atomic Counters API - Increment by 1, return current

Regarding updating the column value without receiving the previous value: we are now considering adding this functionality (BKNDLSS-20855).

1 Like

Do we have this feature now? I mean updating a column value without receiving the previous value. I want to be able to increment or decrement an integer field by one.

The ticket BKNDLSS-26416 is now associated with this feature. It will take about 3 weeks before it is released.

Regards,
Olha

1 Like

Thank you. Am waiting…

What is the status of this ticket BKNDLSS-26416?

Hi. The task in our roadmap, but not in the priority group.
I think, within a month it is definitely not worth expecting.

Has this feature been created?

Hi @Nkekere_Tommy_Minimann

Not yet, we will notify you in the topic once it’s done

Regards, Vlad

Hi guys, I still don’t see much info about how to use atomic counters to increment a data column in my search. In the meantime while waiting on BKNDLSS-26416, is my example below similar to how you are doing it for now? (spoken is the column name)

If there’s a better way, please let me know. Learning as I go. Thank you!

Hello, @Hung_Le.

Ticket BKNDLSS-26416 already done. We forgot to report about task status in this topic.
You already can use Atomic API to achieve your results.

Regards, Nikita.

Sorry for the confusion, I meant to say (BKNDLSS-20855). Did not know there were 2 tickets being discussed here. Have we any updates around this functionality?

Hello @Hung_Le

Codeless already supports BackendlessExpression.
If you need to increase the value of the age field in the Person table by 1:

Regards,
Volodymyr

1 Like

What?! Thank you! BackendlessExpression! This topic is pretty much resolved then. Wonderful. God bless!