From 58fda9d7e1513f484bd052bb85e52727ed8680b2 Mon Sep 17 00:00:00 2001 From: Daniel Mewes Date: Tue, 19 May 2015 11:04:19 -0700 Subject: [PATCH] Replace returnVals by returnChanges --- todo-angular-express-promise/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);