Skip to content

Commit

Permalink
Update rethinkdb adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Justkant committed Dec 31, 2015
1 parent 55e9c33 commit 7fb38de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/adapters/rethinkdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ RethinkDB.prototype.save = function (model, data, callback) {
if (data[key] === undefined)
data[key] = null;
});
r.db(self.database).table(model).insert(data, {upsert: true}).run(client, function (err, notice) {
r.db(self.database).table(model).insert(data, {conflict: 'replace'}).run(client, function (err, notice) {
self.pool.release(client);
err = err || notice.first_error && new Error(notice.first_error);
callback(err, notice);
Expand Down Expand Up @@ -383,7 +383,7 @@ RethinkDB.prototype.updateOrCreate = function updateOrCreate(model, data, callba
data[key] = null;
}
});
r.db(self.database).table(model).insert(data, {upsert: true}).run(client, function (err, m) {
r.db(self.database).table(model).insert(data, {conflict: 'replace'}).run(client, function (err, m) {
self.pool.release(client);
err = err || m.first_error && new Error(m.first_error);
callback(err, err ? null : m['generated_keys'][0]);
Expand Down Expand Up @@ -686,4 +686,4 @@ function _processWhere(self, model, where, promise) {
});

return promise;
}
}

0 comments on commit 7fb38de

Please sign in to comment.