duanbi6522 2015-10-02 02:42
浏览 20
已采纳

当没有结果时,RQL'过滤器'返回

When your filter finds no result, what does it return? Does it return a null value, an empty string, a json document describing the fact that there were no results found? If I were to run r\table('users')->filter(array('user_name' => $user_name))->run($this->r) and there were no users found by that name, what would Rethink return?

I can't seem to find this on the extended docs for filter or the regular API documentation.

  • 写回答

1条回答 默认 最新

  • douqiang5809 2015-10-02 05:39
    关注

    It returns an empty selection. Think of it like an empty array, or an empty enumerable, empty set,..depend on how your driver and type system of language.

    I can't seem to find this on the extended docs for filter or the regular API documentation

    You can try to get this yourself by using the Data Exploer(for quickly get the result) and typeOf command.

    r.db("rewl")
        .table("issues")
      .filter( function (item) {
            return item('date').eq(r.now())
      })
      .typeOf()
    

    It prints out:

    "SELECTION<STREAM>"
    

    You also should use RAW VIEW in Data Explorer because it shows raw data, such as instead of saying No result it shows an empty array []. That helps when trying to learn ReQL.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用