04-02-2020, 10:42 PM
(02-20-2020, 05:35 PM)mark_talluto Wrote: Using the existing APIs would be destructive if multiple people were hitting the same value. The last person to write using cdb_update would win. Sync is a little different. Based on your params, the first or the last could win. Neither would be suitable for this scenario.
I think there are two ways we could solve this.
Improve cdb_update or make a new API for math operations
Store the updates as new records (like a ledger) and do the math when you want to know the result.
Both methods are useful to have. It depends on how you want to store your data in this scenario. We will toss #1 around in the studio and see what we come up with.
Hi Mark,
Will the API for math operations be available soon? I am at a point in the development where I need it.
This will be a great feature and save on unnecessary code.
A simple one that can update a key in a record by adding, subtracting, multiplying, or dividing the existing number/fraction in the key by the specified number and updating the key with the result will be awesome.
Sid