We're building a probably rather atypical use case...
# community-help
e
We're building a probably rather atypical use case with Typesense. We have a POS application in which we want need to build an inventory solution (to count all the articles in a store). I think it's a super neat use case for the JOINs, but one thing would be super cool: Updating a document not with an absolute value, but with a +1. e.g. the field "count" has the value "3" and I upsert the document with count+1, it would get the value 4. Is something like this planned or even does make sense for you guys? 🙂
k
There are a couple of reasons why we don't expose an increment operation: 1. Given Typesense is a secondary indexing system, our goal is for the search engine to reflect the state of the primary data store. Providing an increment operation might make this sync difficult because if there is some bug in the indexing logic that retries the same update operation, you could end up with double increments which won't match with the primary data store anymore. 2. Updating a value still involves reading the entire document back from disk, updating a single value and rewriting the entire document back. So there is not much benefit in terms of I/O costs.