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

Provide function for copying documents #288

Open
SteffenGorenflo opened this issue Jun 23, 2015 · 0 comments
Open

Provide function for copying documents #288

SteffenGorenflo opened this issue Jun 23, 2015 · 0 comments

Comments

@SteffenGorenflo
Copy link

I came across a problem, where I needed to copy a whole document and only change a single value. When I consulted the couchdb wiki, I found this article https://wiki.apache.org/couchdb/HTTP_Document_API#COPY but there is no corresponding function in cradle.

The workaround I'm currently using is

var options = {
  method: 'COPY',
  path: '/' + originalDocumentID,
   headers: {
     destination: newDocumentId
    }
 };

db.query(options, function (err, data, response) {
         // handle response
});

Could it be possible to provide this function? Just a proposal, I can live with that workaround.

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

No branches or pull requests

1 participant