2013-03-03 66 views
0

我正在努力学习更多关于RethinkDB及其子查询能力。我在想,如果下面会在ReThinkDB可能:在ReQL/Rethink中使用子查询过滤出结果?

// example of "post" document: 
{ id: .., allow: [], disallow: [some_label_id, other_label_id], ... } 

// example of "label" document: 
{ id: .., user_id: .., name: 'my-label' } 

var MY_USER_ID = "1b4-4c6-7d9" 

// Query in psuedo-code: 
IN database test 
IN table posts 
FILTER out any "posts" where the "disallow" array 
    contains a value found in this sub-query: 
    IN table labels 
    FILTER id .eq disallow[index] AND user_id .eq MY_USER_ID 

回答

1

RethinkDB目前没有相交包含命令。他们将暂定于4月15日发布1.4版本。