title: Synchronization multi request payment express nodejs
body: <p>Today I am building RESTful API recharge money with mongoose. This include increase and decrease. I want amount never get bellow than 0.</p>
  
  <p>No problem if multi request increase by one account. But I request very very fast multi request recharge a account It broken!!!!</p>
  
  <p>This is a example decrease money of a account:</p>
  
  <pre><code>app.post("/recharge",function(req,res){
      Bottle.findById({user: "foo"}, function (err, user) {
      if(user.money &lt;= 0) return res.json({message: "Not enough money"});
      else {
          user.money -=5000;
          user.save();
          return res.json({message: "Give success"});
          }    
      })
  }
  </code></pre>
  
  <p>I set <strong>foo</strong> money = <strong>5000</strong></p>
  
  <p>Then a make fast 10 request in 0.001s. Then I check my database It show fo money <strong>-25000</strong></p>
  
  <p>It is not Synchronization? </p>
  
  <p>why  <code>if(user.money &lt;= 0) return res.json({message: "Not enough money"});</code> didn't work? </p>
  
  <p>Help me please. Every answer will be accepted!</p>