Skip to content

Commit

Permalink
Merge pull request #76 from Justkant/master
Browse files Browse the repository at this point in the history
Update rethinkdb adapter
  • Loading branch information
biggora committed Dec 31, 2015
2 parents 55e9c33 + 7fb38de commit 6f10275
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 6f10275

Please sign in to comment.