convert repo scratchpad set/update to be atomic mongo opertions.