Operators

Comparison Operators

MySQLMongoDB

=

$eq

<>

$ne

>

$gt

<

$lt

>=

$gte

<=

$lte

in

$in

not in

$nin

Example

//

db.friendsCollection.find(
    {"lastname":{$nin:["Geller","Green"]}}
)

// 

db.friendsCollection.find(
    {"lastname":{$nin:["Geller","Green"]}}
).count()

Logical Operators

MySQLMongoDB

and

$and

or

$or

not

$not

Last updated