mongodb compare two key gt or lt code example Example: mongodb greater than db.yourDataBase.find({counter:{$gt:2}})