Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutates the given doc by adding a _revisions property. #17

Open
jemc opened this issue Jul 4, 2016 · 1 comment
Open

Mutates the given doc by adding a _revisions property. #17

jemc opened this issue Jul 4, 2016 · 1 comment

Comments

@jemc
Copy link

jemc commented Jul 4, 2016

When I pass a doc to put, it does not mutate the doc, and I can use it again expecting it to be the same. When I pass a doc to validatingPut, it mutates the doc by adding a _revisions property.

I'd like to be able to pass an doc to validatingPut without it mutating the doc.

EDIT: Same goes for validatingBulkDocs and others.

@jemc jemc changed the title Mutates the given doc with a _revisions property. Mutates the given doc by adding a _revisions property. Jul 4, 2016
@marten-de-vries
Copy link
Member

Thanks for reporting. Yes, it should copy the document before modifying it. (The modification itself is in line which CouchDB's behaviour, but it still shouldn't modify input.)

If anyone wants to work on this (it should be a relatively simple matter of modifying/adding an extend() call), keep an eye on pouchdb/pouchdb-server#143 ; this repository is probably going to be deprecated in favour of that one soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants