change id to _id for rest backend

I am getting data from a mongodb rest service, so the main id is _id.
how could i do do PUT request to my server with _id instead of the id generated by datatable. it would be great to have an configuration option like in backbone to map _id to id in a rest proxy:

idAttribute: ‘_id’

thank you for your help.

One way could be to create a custom proxy: http://docs.webix.com/desktop__server_proxy.html

It would look a little bit like:

webix.proxy.mongo = webix.extend({
    $proxy: true,
    save:function(view, update, dp, callback){
    
    var data = update.data;

    //call rest URI
    if (mode == "update") {
        data._id = update.data.id;
        delete data.id;
        ajax.headers({"Content-type": 'application/json'});
        ajax.put(url + delimiter + data._id, JSON.stringify(data), callback);
    } else if (mode == "delete") {
          ajax.del(url + delimiter + data.id, data, callback);
    } else {  // Insert ...
         ajax.headers({"Content-type": 'application/json'});
         ajax.post(url, JSON.stringify(data), callback);
    }
}, webix.proxy.rest);                    

thank you so much for your help gartneriet.
thats exactly the piece i was missing. i did not know how to extend a proxy and you showed me.
after thinking about the problem some more i realized that i actually only need to change the _id to id when data is loaded from the server. everything else works afterwards, because webix is happy to have an ‘id’. this is the code i’m using:

    webix.proxy.mongo = webix.extend({
    $proxy: true,
    load: function(view, callback) {
      var url;
      url = this.source;
      return webix.ajax().get(url).then(function(res) {
        var data;
        data = res.json().map(function(item) {
          item.id = item._id;
          delete item._id;
          return item;
        });
        return webix.ajax.$callback(view, callback, {
          data: data
        });
      });
    }
    }, webix.proxy.rest);

it would have taken me hours without your great tip.

have a great day

metta