【问题标题】:Filtering out results using sub-queries in ReQL/Rethink?使用 Real/Rethink 中的子查询过滤掉结果?
【发布时间】:2013-03-03 10:42:40
【问题描述】:

我正在尝试更多地了解 RethinkDB 及其子查询功能。我想知道 ReThinkDB 中是否可以实现以下功能:

// 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

【问题讨论】:

    标签: rethinkdb in-subquery nosql


    【解决方案1】:

    RethinkDB 目前没有 intersectcontains 命令。它们将在暂定于 4 月 15 日发布的 1.4 版本中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-10
      • 2014-03-31
      相关资源
      最近更新 更多