diff --git a/todo-angular-express-promise/app.js b/todo-angular-express-promise/app.js index a1ae92e..ccd52b2 100644 --- a/todo-angular-express-promise/app.js +++ b/todo-angular-express-promise/app.js @@ -43,7 +43,7 @@ function create(req, res, next) { var todo = req.body; todo.createdAt = r.now(); // Set the field `createdAt` to the current time - r.table('todos').insert(todo, {returnVals: true}).run(req._rdbConn).then(function(result) { + r.table('todos').insert(todo, {returnChanges: true}).run(req._rdbConn).then(function(result) { if (result.inserted !== 1) { handleError(res, next)(new Error("Document was not inserted.")); } @@ -60,7 +60,7 @@ function create(req, res, next) { function update(req, res, next) { var todo = req.body; if ((todo != null) && (todo.id != null)) { - r.table('todos').get(todo.id).update(todo, {returnVals: true}).run(req._rdbConn).then(function(result) { + r.table('todos').get(todo.id).update(todo, {returnChanges: true}).run(req._rdbConn).then(function(result) { res.send(JSON.stringify(result.new_val)); }).error(handleError(res)) .finally(next);