>

ReQL command: >, gt

Command syntax

value.gt(value[, value, ...]) → bool
value > value → bool

Description

Compare values, testing if the left-hand value is greater than the right-hand.

Example: Test if a player has scored more than 10 points.

r.table('players').get(1)['score'].gt(10).run(conn)
# alternative syntax
(r.table('players').get(1)['score'] > 10).run(conn)

Example: Test if variables are ordered from lowest to highest, with no values being equal to one another.

a = 10
b = 20
c = 15
r.gt(a, b, c).run(conn)

This is the equivalent of the following:

py` r.gt(a, b).and(r.gt(b, c)).run(conn)

Related commands

Get more help

Couldn't find what you were looking for?

© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/python/gt/

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部