$gt¶
-
$gt¶ Syntax:
{field: {$gt: value} }$gtselects those documents where the value of thefieldis greater than (i.e.>) the specifiedvalue.Consider the following example:
This query will select all documents in the
inventorycollection where theqtyfield value is greater than20.Consider the following example that uses the
$gtoperator with a field from an embedded document:This
update()operation will set the value of thepricefield in the first document found containing the embedded documentcarrierwhosefeefield value is greater than2.To set the value of the
pricefield in all documents containing the embedded documentcarrierwhosefeefield value is greater than2, specify themulti:trueoption in theupdate()method: