You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your create example, the result.new_val is undefined. Looks like maybe this has changed?
// Create a new todo
function* create(next) {
try{
var todo = yield parse(this);
todo.createdAt = r.now(); // Set the field `createdAt` to the current time
var result = yield r.table('todos').insert(todo, {returnVals: true}).run(this._rdbConn);
todo = result.new_val; // todo now contains the previous todo + a field `id` and `createdAt`
this.body = JSON.stringify(todo);
}
catch(e) {
this.status = 500;
this.body = e.message || http.STATUS_CODES[this.status];
}
yield next;
}
The text was updated successfully, but these errors were encountered:
Looks like the API has changed (in particular, returnVals was renamed to returnChanges), but the example hasn't been updated. Thanks @chovy. Could someone do a pull request?
In your
create
example, theresult.new_val
is undefined. Looks like maybe this has changed?The text was updated successfully, but these errors were encountered: