Hey team :wave: *Is there any way to do an atomic ...
# community-help
s
Hey team 👋 Is there any way to do an atomic increment/decrement on a numeric field in a single API call, similar to MongoDB's
$inc
?
Use case: I have a
quantity
(int32) field and want to decrement it by N, without doing a GET first to fetch the current value. I know "Update by Query" supports setting an absolute value in one call, but I couldn't find any server-side increment operator in the docs. Is GET + PATCH the only option today? @Sahil Rally
f
Hey Sameer, You can't increment an integer field by a query in Typesense. You have to pass the new values in an import request with an emplace / update action