Skip to main content

What does $lt do?

$lt (less than) is an operator that selects documents where a field's value is strictly less than the given one.

Example:

js
db.users.find({ age: { $lt: 30 } })

This query returns every document where age is less than 30.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.