Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 814 Bytes

File metadata and controls

44 lines (34 loc) · 814 Bytes
layout api-command
language JavaScript
permalink api/javascript/lt/
command lt
io
value
bool
related_commands
eq ne gt ge le
eq/
ne/
gt/
ge/
le/

Command syntax

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

Description

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

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

r.table('players').get(1)('score').lt(10).run(conn, callback);

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

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

This is the equivalent of the following:

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