In short: “it depends”.
Basically you’re asking what’s the likelihood that the document will have been changed between the client previously reading the old value and the server processing the request to update to the new value - and this will depend on a number of factors - some of which are:
- How long does it take for the previous document to be returned over the network from the cluster to the client?
- How long does the client take to construct the new document?
- How long does the request take to get over the network to the cluster node?
- How long does the request take to be read and processed by the cluster node?
These are all going to depend on network latency, client speed, cluster load, etc.
With the information you’ve given it’s basically impossible to say. I suggest you do some measurements / experiments on your workload and environment and calculate what the likelihood is and pick a suitable retry count.
Alternatively you could test empirically and see how many retries you need in a representative test scenario.