Should be possible but I am not sure if mongodb transactions work on standalone servers yet, I think they are only for sharded clusters and replica sets.
In version 4.0, MongoDB supports multi-document transactions on replica sets.
In version 4.2, MongoDB introduces distributed transactions, which adds support for multi-document transactions on sharded clusters and incorporates the existing support for multi-document transactions on replica sets.
To use transactions on MongoDB 4.2 deployments(replica sets and sharded clusters), clients must use MongoDB drivers updated for MongoDB 4.2.
More info here https://docs.mongodb.com/manual/core/transactions/
Redis has multi for transactions so we could aim for something like this in our dbal layer.
const tx = db.transaction();
tx.setObject('user:' + uid, data);
tx.sortedSetAdd('users:joindate', Date.now(), uid);
So both commands are executed atomically.