Comparison operators filter data based on value comparisons such as less than and greater than.比较运算符根据值比较(如小于和大于)筛选数据。
For comparison of different BSON type values, see the specified BSON comparison order.有关不同BSON类型值的比较,请参阅指定的BSON比较顺序。
$eq | |
$gt | |
$gte | |
$in | |
$lt | |
$lte | |
$ne | |
$nin |
Compatibility兼容性
You can use comparison operators for deployments hosted in the following environments:您可以对以下环境中托管的部署使用比较运算符:
- MongoDB Atlas
: The fully managed service for MongoDB deployments in the cloud:云中MongoDB部署的完全托管服务
- MongoDB Enterprise
: The subscription-based, self-managed version of MongoDB:MongoDB的基于订阅的自我管理版本 - MongoDB Community
: The source-available, free-to-use, and self-managed version of MongoDB:MongoDB的源代码可用、免费使用和自我管理版本