I’m curious what the best way to do something functionality similar to what MongoDB’s upsert gives you.
We need to take in values (integers) at a very high rate and slot them into the appropriate key value pairs. This means setting them to the first number if they don’t exist already, or adding them to the existing number if they already exist.
MongoDB’s upsert function does exactly this and I’m curious how we can do this in Aerospike. I tried doing an increment on a value that didn’t exist yet but it errored out saying the key didn’t exist.
I see that there’s a concept of chaining operators together… would it be possible to do this with something like:
if foo doesn’t exist: set foo to 2 if foo already exists: add 2 to current value of foo
Thanks in advance