Database

[{"id":1,"like":3},{"id":2,"like":1}]

Query

db.collection.aggregate([{"$match":{"id":1}},{"$set":{"count":{$cond:{if:{$gt:["$like",0]},then:{"$subtract":["$like",1]},else:0}}}}])

Result