How to make an if condition inside findByIdAndUpdate

I am trying to perform an if condition inside find and update then add a value actually it works well without the if condition and successfully increment the value, i search alot if the condition is wrong from mongoDB but the syntax is working at mongoDB side also find it in mongoDB documents so hwo to do like so in strapi.

      { if: impression <= noOfDisplay || popup.unlimited === true,
       then: {$set:{"consumer.impression": impression+=1}} , else: {}}