Skip to content

Confusion about upsert and delta functions in the docs #8806

Closed Answered by aderchox
aderchox asked this question in Q&A
Discussion options

You must be logged in to vote

I've got it now! BUT the docs are really unclear / need more explanation in some parts, including this part, IMHO.
The upsert() retries doing put() "using a different _rev every time" (because it re-gets the document and then retries put()ing. (based on https://github.com/pouchdb/upsert/blob/9c781fc3f623c6f4622afa755b197ced1540c138/dist/pouchdb.upsert.js#L9)
Also the role of the delta function is providing the change as a function, rather than providing the changed document itself. (So that the change remains doable on newer revision of the document as well.)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aderchox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant