-- MongoDB

[MongoDB] 조건연산

어린왕자악꿍 2013. 1. 2. 14:25
쿼리 시 조건을 지정할 때 사용한다.
 

$gt

>

$lt

<

$gte

>=

$lte

<=

 

> db.person.find({ age : { $gt : 20 }})

> db.person.find({ age : { $lt : 20, $gt : 22 }})

 

$ne

Not equal

 

> db.person.find({ age : { $ne : 20 } })

 

$not

 

> db.person.find({ age : { $not : { $lt : 10 } } })