Closed kpetros closed 6 years ago
All write requests, including patch have upsert semantic.
To avoid creating a document, you can use a bulk PATCH
PATCH /db/coll/*?filter={ condition } { "foo": "bar" }
To avoid updating a document you can pass the query parameter checkEtag
PATCH /db/coll/docid?checkEtag
This returns 412 Precondition Failed
if document with _id=docid
exists. See http://restheart.org/learn/etag/
According to documentation, it seems to me that PATCH db/coll/docid shouldn't perform upserts. When there is no document matching the id, i expect a 404 NOT FOUND response. Instead, a new document is created and the response code is 201 CREATED. PATCH db/coll/docid return codes
I use version 3.2.2