Closed notslang closed 9 years ago
I don't really understand your question. Do you want the diffFun
to be passed a document that doesn't contain the _rev
? Or what do you mean?
Do you want the diffFun to be passed a document that doesn't contain the _rev?
yes, exactly.
But what about the _id
? Or the _attachments
? Or _deleted
? It's not really clear what to do about those. Also, it's not really clear what to do with first-generation documents (i.e. the doc doesn't exist yet) vs n+1th-generation documents (i.e the doc and rev both already exist).
I kinda feel like your approach is pretty reasonable. Get rid of the _rev
, then compare. Although shouldn't you get rid of the _rev
in both the oldPost
and the post
?
Closing for reasons described in https://github.com/pouchdb/upsert/pull/3
I find this rather odd because having a diff function eliminates the need for comparison based on revisions, and the
upsertInner
function handles setting the_rev
for you. Could we get rid ofthat_the_rev
property in the supplied document_, so I don't need to delete it, or is there a use-case for keeping it?