I'm looking at doing record-level locking in order to prevent multiple users from accessing the same record(s) at any one time. To my knowledge there is nothing inherent in Mongoose to support such a notion. I'm aware of the opportunistic locking used by Mongoose as well as property level locking. Neither of which accomplishes what I'm after.
Obviously I can write the current user ID to the record(s) in use and perform a check for a non-null value on the way in, etc. There are obvious potential performance issues and possible race conditions with this method though.
Was just wondering if anyone had done anything like this already and would be willing to share your strategy for such an undertaking?
Or am I over-thinking this and there is something in Mongoose that would provide what I'm looking for?