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 |
What it means
Section titled “What it means”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.
Status
Section titled “Status”Always 409.
Where it comes from
Section titled “Where it comes from”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"]}What to do
Section titled “What to do”- 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
--overwritetomockhub store import.