thinker
thinker copied to clipboard
Handle tables that don't use the default primary key field name id
Handle tables that don't use the default primary key field name id, you can retrieve the primary key of the source table through r.db(sourceDb).table(table).info()('primary_key') and pass it into the tableCreate call through the primaryKey opt arg.
@internalfx Is that fixed for the sync command? I tried to sync two dbs and that's the error I'm getting:
{ ReqlOpFailedError: Index `id` was not found on table `db.table` in:
r.db("db").table("table").orderBy({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index: r.asc("id")
^^^^^^^^^^^^^^^^^^
}).map(function(var_6) {
^^^^^^^^^^^^^^^^^^^^^^^^
return {
^^^^^^^^
id: var_6("id"),
^^^^^^^^^^^^^^^^
hash: r.uuid(var_6.toJSON())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
^
})
^^
@thinklinux :frowning:
I'm guessing no.....and I will have another look.
Thanks for reporting.