Corona icon indicating copy to clipboard operation
Corona copied to clipboard

RFE: Server-Side Update

Open dscape opened this issue 14 years ago • 4 comments

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;
       });
};    

dscape avatar Sep 27 '11 21:09 dscape

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?

hunterhacker avatar Sep 27 '11 21:09 hunterhacker

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 < [email protected]>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

dscape avatar Sep 28 '11 04:09 dscape

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

hunterhacker avatar Sep 28 '11 05:09 hunterhacker

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.

hunterhacker avatar Nov 01 '11 23:11 hunterhacker