我想把两张桌子连接起来。我正在运行的命令是:
r.table("userclientmap").eq_join("user_id", r.table("users"))我的“用户”表如下所示:
[
{
"email": "nielsen.ruben@gmail.com"
"password": "$2a$10$nO4/KHYkKRcx3D8GYwMCVu.gtsWd1SWzWz27N.TdxqdD9bf.LBXI6"
}
]我的“userclientmap”表如下所示:
[
{
"client_id": "3c0e6447-ab2f-401e-a09d-d84c32406fe2" ,
"id": "d6356002-9e51-4f82-afb7-49799f7b5ded" ,
"user_id": "nielsen.ruben@gmail.com"
}
]在从管理控制台运行查询时,会收到以下错误:
无法执行查询。
r.table("userclientmap").eq_join("user_id", r.table("users"))错误:
TypeError: Object function () {
var args;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
if (args.length !== fun.length) {
throw new err.RqlDriverError("Expected " + fun.length + " argument(s) but found " + args.length + ".");
}
return fun.apply(this, args);
} has no method 'eq_join'我真的不知道从这里往哪里走。我的查询看起来与http://rethinkdb.com/docs/table-joins/文档中的查询一模一样
我正在运行rethinkdb版本1.8.1-0ubuntu1~raring (GCC 4.7.3)
发布于 2013-09-09 10:58:54
管理UI中的数据资源管理器使用JavaScript,而joins文档(http://rethinkdb.com/docs/table-joins/)则使用Python示例。eqJoin是JavaScript驱动程序在Python中的eq_join。
你应该使用:
r.table('userclientmap').eqJoin('user_id', r.table('users'))
(见http://www.rethinkdb.com/api/#js:joins-eqJoin)。
https://stackoverflow.com/questions/18695979
复制相似问题