Use a server-side script to simulate putIfAbsent(…) as contracted by the Map interface. The operation will be atomic since MongoDB will put a lock on database until the script is finished.
Use a server-side script to simulate putIfAbsent(…) as contracted by the Map interface. The operation will be atomic since MongoDB will put a lock on database until the script is finished.