Conditional Operators in MOngo db c#.net

Here in this blog i will discuss the conditional operator in MOngo db

IN sql query we are familiar in this conditional operator
<, <=, >, >=
 
IN mongo db json we have to write 
  1. db.collection.find({ "field" : { $gt: value } } );   // greater than  : field > value  
  2. db.collection.find({ "field" : { $lt: value } } );   // less than  :  field < value  
  3. db.collection.find({ "field" : { $gte: value } } );  // greater than or equal to : field >= value  
  4. db.collection.find({ "field" : { $lte: value } } );  // less than or equal to : field <= value   
For example 
  1. db.things.find({j : {$lt: 3}});  
  2. db.things.find({j : {$gte: 4}});  
You can also combine these operators to specify ranges: 
  1. db.collection.find({ "field" : { $gt: value1, $lt: value2 } } );    // value1 < field < value