$gt¶
-
$gt
¶ Syntax:
{field: {$gt: value} }
$gt
selects those documents where the value of thefield
is greater than (i.e.>
) the specifiedvalue
.Consider the following example:
This query will select all documents in the
inventory
collection where theqty
field value is greater than20
.Consider the following example which uses the
$gt
operator with a field from an embedded document:This
update()
operation will set the value of theprice
field in the documents that contain the embedded documentcarrier
whosefee
field value is greater than2
.