Back to top

ReQL command: <=, le

Command syntax

value.le(value[, value, ...]) → bool

value <= value → bool

Description

Compare values, testing if the left-hand value is less than or equal to the right-hand.

Example: Test if a player has scored 10 points or less.

r.table('players').get(1)['score'].le(10).run(conn)
# alternative syntax
(r.table('players').get(1)['score'] <= 10).run(conn)

Example: Test if variables are ordered from highest to lowest.

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

This is the equivalent of the following:

r.le(a, b).and(r.le(b, c)).run(conn)

Get more help

Couldn't find what you were looking for?