Skip to content

Claim it, or fail

A ConditionExpression lets a write happen only if the data still allows it.

Why

A PutItem normally overwrites whatever shares its key. A ConditionExpression guards it: the write happens only if the condition holds at the instant it runs, atomically, with no read-first race for two callers to lose.

Claim a free callsign and attribute_not_exists(pk) passes. Claim one alice already holds and the engine rejects the write with a ConditionalCheckFailedException, leaving her record untouched. Read it back to confirm. This is how you register something exactly once.

A condition turns a blind write into a guarded one. attribute_not_exists is a first-writer-wins claim, enforced at write time.

Try it. Then change it.

Predict what each request will do. Run it, inspect the response, then change a value in the workbench and try again.

  1. attribute_not_exists(pk) means 'only if nobody holds this'. The callsign is free, so the write lands.

  2. The same condition against m0abc, which alice already holds. The engine rejects it: ConditionalCheckFailedException.

  3. Read m0abc back: still alice. The rejected claim changed nothing.

Built on this

CallsignsDynamoDB workbench
Ready to run
Explore an access patternSelect to load & run

attribute_not_exists(pk) means 'only if nobody holds this'. The callsign is free, so the write lands.

Request
Execute against the local Dynoxide engine
ReturnedFiltered outChanged
pk(pk)
owner
claimedAt
HANDLE#m0abc
aliceS
2026-01-04S
HANDLE#g4xyz
rajS
2026-02-11S
HANDLE#k2def
meiS
2026-03-02S
HANDLE#vk3ghi
tomS
2026-03-19S
HANDLE#ja1jkl
yukiS
2026-04-08S
HANDLE#ea5mno
sofiaS
2026-05-21S
Awaiting request
Your next query starts here.

Choose an access pattern above, or build your own request. See what comes back and what it costs.

Powered by DynoxideWASMStarts on your first run · Runs locally in your browser