marklogic-community / Corona

Community REST API for MarkLogic
Other
37 stars 9 forks source link

RFE: Server-Side Update #8

Open dscape opened 12 years ago

dscape commented 12 years ago

As in

function updateUser(ghUser) {
  console.log("Trying to update github user " + ghUser.login);
  db.json.update_first(
     { github_login: ghUser.login })
       .increment('version', 1)
       .replace('github_login', ghUser.login)
       .replace('github', ghUser)
       .delete('linkedin.deletemeplease')
       .rename('meeutp','meetup')
       .push('anarray', 1)
       .addCollection('github') // also replaceCollection
       .setQuality(9)
       .replacePermissions(['a','b','c']) // also addPermissions
       .save(
         function saveCb(e) {
           if(e) {
             console.log("Couldn't update " + ghUser.login);
             return;
           }
           console.log(ghUser.login + " updated");
           return;
       });
};    
hunterhacker commented 12 years ago

Can you please redo this bug in a way that (a) makes an argument for why it's necessary and (b) that focuses on the REST API directly?

dscape commented 12 years ago

An argument on why transactions are necessary? :)

Will do, when I have the time!! This was fast (just need to copy paste) There were plenty of conversations with me and Ryan and he will be very aware of this issue.

I believe this is even in the roadmap on the wiki as a possible for 1.0 feature.

Nuno

On Tue, Sep 27, 2011 at 2:55 PM, Jason Hunter < reply@reply.github.com>wrote:

Can you please redo this bug in a way that (a) makes an argument for why it's necessary and (b) that focuses on the REST API directly?

Reply to this email directly or view it on GitHub: https://github.com/marklogic/Corona/issues/8#issuecomment-2217014

hunterhacker commented 12 years ago

Yes. It's your RFE so argue your case.

hunterhacker commented 12 years ago

Changed the title to what I think Nuno was asking for.

The issue is that today you can only update a document by pulling it in full to the client, then uploading it in full back. It'd be good to have a way to modify documents declaratively without them leaving the server-side. Easy enough in MarkLogic, but we need to decide on the right syntax to expose the feature.