Rethinkdb - PHP-RQL - Http api - 过滤器响应
Rethinkdb - PHP-RQL - Http api - filter response
我正在研究 Rethinkdb 上的几个教程和示例,并将它们转换为 PHP-RQL 以供我自己学习。
我目前正在查看 http://www.infoworld.com/article/2975838/database/build-real-time-web-apps-with-rethinkdb.html,但不知道如何复制它:
r.http("http://www.reddit.com/r/aww.json")("data")("children")("data").orderBy(r.desc("score")).limit(5).pluck("score", "title", "url")
具体来说,这是我在 PHP 中努力重新创建的初始过滤器 ("("data")("children")("data")") RQL.
如有任何帮助,我们将不胜感激。
谢谢
这些查询词是来自 ReQL 的 BRACKET
词,在这种情况下(因为它们是用字符串调用的),它们等同于 GET_FIELD
词。我没有使用 PHP 客户端驱动程序,但是可以使用这些术语的一些文档 here。
这些有用法示例,看起来是等价的:
Example: What was Iron Man's first appearance in a comic?
$ironMan = r\table('marvel')->get('IronMan');
$ironMan('firstAppearance')->run($conn)
r\table('marvel')->get('IronMan')->getField('firstAppearance')->run($conn)
也许 BRACKET
字词不能像大多数其他字词一样链接到查询。
我正在研究 Rethinkdb 上的几个教程和示例,并将它们转换为 PHP-RQL 以供我自己学习。
我目前正在查看 http://www.infoworld.com/article/2975838/database/build-real-time-web-apps-with-rethinkdb.html,但不知道如何复制它:
r.http("http://www.reddit.com/r/aww.json")("data")("children")("data").orderBy(r.desc("score")).limit(5).pluck("score", "title", "url")
具体来说,这是我在 PHP 中努力重新创建的初始过滤器 ("("data")("children")("data")") RQL.
如有任何帮助,我们将不胜感激。
谢谢
这些查询词是来自 ReQL 的 BRACKET
词,在这种情况下(因为它们是用字符串调用的),它们等同于 GET_FIELD
词。我没有使用 PHP 客户端驱动程序,但是可以使用这些术语的一些文档 here。
这些有用法示例,看起来是等价的:
Example: What was Iron Man's first appearance in a comic?
$ironMan = r\table('marvel')->get('IronMan'); $ironMan('firstAppearance')->run($conn) r\table('marvel')->get('IronMan')->getField('firstAppearance')->run($conn)
也许 BRACKET
字词不能像大多数其他字词一样链接到查询。