#community-help

Using Conditions on Upserts in Typesense

TLDR Jacob inquired about using conditions on upsert commands in Typesense. Kishore Nallan guided Jacob to a relevant open feature request on GitHub to upvote.

Powered by Struct AI
Sep 21, 2022 (15 months ago)
Jacob
Photo of md5-c60456339dc3724ba99c3f7ca170d671
Jacob
05:46 AM
Hi! Is it possible to use conditions on upserts? My use case is that I want to update a lowest_price property, but only if the new price is lower than already stored price. There might be many parallell incoming price-updates, so reading the value and then doing the update will not work as it will create a race condition.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:48 AM
Hi Jacob 👋

We've a feature request open for this, but it's not implemented yet.: https://github.com/typesense/typesense/issues/496

Can you please upvote that issue? It's certainly a useful feature, so we will prioritize this in the near future.
Jacob
Photo of md5-c60456339dc3724ba99c3f7ca170d671
Jacob
06:02 AM
Will do! Thanks for the quick reply!