Mongodb中的比较运算符

时间:2019-07-06 16:50:13

标签: mongodb

这是一小部分记录:

employee_id first_name  last_name   supervisor  hourly_pay     total_hours
1001        Andrew      Adams       Frank Smith $18.00      25
1002        Nancy       Edwards     Frank Smith $32.00      40
1003        Jane        Smith       Ted Jones   $16.00      18
1004        Margaret    Park        Ted Jones   $20.00      46
1005        Steve       Johnson     Ted Jones   $21.00      36
1006        Michael     Mitchell    Ted Jones   $28.00      36
1007        Robert      King        Ted Jones   $18.00      30
1008        Laura       Callahan    Ted Jones   $25.00      10
1009        Neena       Kochhar     Ted Jones   $36.00      15
1010        Lex         De Haan     Ted Jones   $25.00  

这些是我正在尝试的一些代码,但是我总是会出错:

db.employees.find( {"hourly_pay":{$lt:20}}) 

db.employees.find( {"hourly_pay": { $lte: 20 } } )

db.employees.find( {"hourly_pay": {$gt : 21 } } )

0 个答案:

没有答案