I know that I can\'t lock a single mongodb document, in fact there is no way to lock a collection either.
However, I\'ve got this scenario, where I think I need some
If the order of the elements in the array is not important for you then the $push operator should be safe enough to prevent threads from overwriting each others changes.