I have customers waiting to talk to CSRs, and each CSR will click on a button on UI to get the next customer (longest waiting). I want to avoid race condition here, means no two CSR should be assigned to same customer waiting their turn on the line.
I am thinking to use findAndModify of MongoDB, but will that solve the issue?
There is a collection “CustomerSessions”, in which a CSR will be assigned for each Customer.