1.

Finding Documents using Operators

Answer»

The MongoDB shell provides the following methods to find documents using operators:

OperatorDescriptionCommands
$gt greater than db.docx.find({class:{$gt:'T'}
$gte greater than equalsdb.docx.find({class:{$gt:'T'}
$lt lesser than db.docx.find({class:{$lt:'T'}
$ltelesser than equalsdb.docx.find({class:{$lte:'T'}
$existsdoes an attribute exist or notdb.docx.find({class:{$gt:'T'}
$regexMatching pattern in pearl-styledb.docx.find({name:{$regex:'^USS\\sE'}})
$type search by type of an elementdb.docx.find({name : {$type:4}})



Discussion

No Comment Found