この例を使用して ID の配列に参加しようとしています: https://github.com/rethinkdb/rethinkdb/issues/1533#issuecomment-26112118
テーブルのスニペットを保存します
{
"storeID": "80362c86-94cc-4be3-b2b0-2607901804dd",
"locations": [
"5fa96762-f0a9-41f2-a6c1-1335185f193d",
"80362c86-94cc-4be3-b2b0-2607901804dd"
]
}
場所の表のスニペット
{
"lat": 125.231345,
"lng": 44.23123,
"id": "80362c86-94cc-4be3-b2b0-2607901804dd"
}
店舗を選択して、その店舗の場所に参加したいと思います。
ReThinkDB 寄稿者からの元の例:
r.table("blog_posts")
.concat_map(lambda x: x["comment_ids"].map(lambda y: x.merge("comment_id" : y)))
.eq_join("comment_id", r.table("comments"))
私のJSへの変換の試み
r.table("stores")
.concatMap((function(x){
return x("locations").map((function(y){
return x("locations").add(y);
}))
}))
.eqJoin("locations", r.table("locations"))
結果
RqlRuntimeError: Expected type ARRAY but found STRING