Based on the RethinkDB replace() docs I am trying to change the primary key of a document. In this case, the primary key is email
:
var renamePerson = function(originalEmail, newEmail, cb){
rethink.db(DATABASE).table(TABLE).get(originalEmail).replace({email: newEmail}).run(dbConnection, cb)
}
This should work, but unchanged
is 1
, and looking up the new document doesn't seem to return any results.
How can I change the primary key of a document?