Database

[{"firstValue":6,"secondValue":3},{"firstValue":6,"secondValue":5},{"firstValue":6,"secondValue":7}]

Query

db.collection.aggregate({"$match":{"$expr":{$gt:[{"$subtract":["$firstValue","$secondValue"]},2]}}})

Result