I have a database of sports players that contains their "skills." For example, a soccer player in the database has 14 skills. Every day I imitate the training of their skill so prepared that the day is increased by a certain amount. My collection has over 1.5 million entries, so I am doing a massive update. The problem is that using $ inc, it can set the limit, in my case the skill limit is 100. How can I set the limit on the field, so it wonβt be updated anymore if it exceeds the limit?
I also tried to βfixβ the skills after the update, I mean that after training the simulation, I run a script that iterates all the players, and if it has a field with an exceeded value, I make an update request to fix it. but making 1.5 million separate requests kills the server, just as there are other ways to do this?
Edit: The increased value has some random values ββin the calculations, so this is not the same for all players. But the value can be from 0 to 1, rounded up to the 2nd category, for example, it can be 0.1, 0.2, 0.3 .... 1. Thus, I group players with this value and trained skill and I am updating the database using the $ in operator, which contains the identifiers of players who train the same skill, and their training value is the same.
source
share