Skip to content

Data store record exists

A refusal to add records to a data store collection, because a key is taken.

Field Value
type https://mockhub.dev/problems/store-record-exists
Status 409

Adding a record never replaces one. A new record in the record dialog is written only while its key is free (If-None-Match: *), and an import that adds records refuses the whole import when any of its keys is taken, so nothing is added.

Always 409.

From Save when adding or duplicating a record on the Data store tab, where the dialog says A record with this key already exists. Choose another key, or edit that record. under Key, from Import with Add to the collection, and from mockhub store put --create-only and mockhub store import.

When detail
One key is taken The collection already holds a record with the key "p1".
Several keys are taken The collection already holds records with 3 of these keys. Nothing was added.

taken lists the first keys that are taken.

{
"type": "https://mockhub.dev/problems/store-record-exists",
"title": "Data store record exists",
"status": 409,
"detail": "The collection already holds a record with the key \"p1\".",
"taken": ["p1"]
}
  • Choose another key, or edit the record that holds it.
  • To replace the records with those keys, tick Overwrite records whose key is taken in the import dialog, or pass --overwrite to mockhub store import.

Report a problem with this page