GitHub

layout api-command
language JavaScript
permalink api/javascript/le/
command le
io

value

bool

related_commands
eq ne gt ge lt

eq/

ne/

gt/

ge/

lt/

Command syntax

{% apibody %} value.le(value[, value, ...]) → bool {% endapibody %}

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, callback);

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

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

This is the equivalent of the following:

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

Read the original on github.com ↗