最简单的方法是使用一个简单的find查询
$gt (greater than) operator
这样地:
db.customers.find({salary: {$gt: 4500}}, {name: 1})
// {salary: {$gt: 4500}} will only return customer documents which have a 'customer.salary' that's greater than 4500 ($gt)
// {name: 1} will create a projection with only the name. (you might have to filter the mandatory _id field, if you only want the name, though.)