createOrUpdate

abstract suspend fun createOrUpdate(feature: Feature)(source)

Create or update a feature (upsert operation).

If the feature exists, it will be updated. If it doesn't exist, it will be created. This is useful when you don't know whether the feature already exists in the store.

Note: This method uses last-writer-wins semantics and does not perform optimistic locking. Concurrent calls will overwrite each other without conflict detection. For safer concurrent modifications, prefer update with a transform function, which performs an atomic read-modify-write and may support conflict detection depending on the underlying store implementation.

Example:

store.createOrUpdate(Feature("my-feature", isEnabled = true))

Parameters

feature

Feature to create or update