Hi All,
I'm having trouble with importing documents using upsert action. Reading
this thread, it seems like several years ago the ask for doing an upsert import with a filter_by was discussed. And the linked Github issue is resolved. But I can't get it to work, and reading the
documentation I'm not sure it was included for upserting. We're using v27.1.
The use case is this:
Changes in our tool generate new or updated documents for TypeSense. I'd like to be able to upsert these (so I don't have to worry about processing inserts and updates separately). And I'd like to be able to do it in bulk (since our tool generates hundreds or thousands of document upserts from a single business event).
I can accomplish this with bulk import and action=upsert. But now I'm also wanting to control for race conditions. I'd like the update half of upsert to only occur if a certain filter_by is true (filter_by=lastUpdated:<{timestamp when I generated this document and queued it for syncing to typesense}
Should this be possible? Using filter_by with import and action=upsert? If not, is there a recommended pattern for safely doing updates that may come out of order?