-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
Description
I'm looking that update command return exception "not found" with unchanged record.
It is ambiguous or normal ?
"js-data": "^3.0.0-rc.6",
"js-data-rethinkdb": "^3.0.0-rc.2",
_update: function _update(mapper, id, props, opts) {
var _this5 = this;
props || (props = {});
opts || (opts = {});
var updateOpts = this.getOpt('updateOpts', opts);
updateOpts.returnChanges = true;
return this.selectTable(mapper, opts).get(id).update(props, updateOpts).run(this.getOpt('runOpts', opts)).then(function (cursor) {
var record = void 0;
_this5._handleErrors(cursor);
if (cursor && cursor.changes && cursor.changes.length && cursor.changes[0].new_val) {
record = cursor.changes.length ? cursor.changes[0].new_val : Object.assign(props,{id:id});
} else {
throw new Error('Not Found');
}
return [record, cursor];
});
}