Curated articles, resources, tips and trends from the DevOps World.
Summary: This is a summary of an article originally published by the source. Read the full original article here →
Today we’re going to see how MongoDB handles locks and how we can achieve Document-level locking.
This basically means we’re somewhat sure that nobody else is going to update our data while we’re working on it.
Using the FindOneAndUpdateAsync API, we can fetch the document and in the same operation, we can set both LockId and LockTime.
When we’re done with the document, we can release it by simply setting to null both LockId and LockTime.
Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com