MongoDB inconsistencies?

I have code where I update a document in one collection, and then in the callback updates a document in another collection. The problem is that sometimes the code in the first collection doesn’t actually update but the callback is called without any error.

Has anyone experienced anything like this before?

The code looks something like this:

const callback = (err, n) => {
  if (err || n === 0) {
    log.error('didnt pick player. leagueId:', leagueId);
  
    return;
  }

  Teams.update(teamId, {
    $addToSet: { playerIds: playerId }
  });
};

const modifier = {
  $push: {
    draftHistory: {
      pickNo: league.draftPick,
      teamId: teamId,
      playerId: playerId
    }
  },
  $inc: {
    draftPick: 1
  },
  $set: {
    nextPickTill: someDate
  }
};

Leagues.update(selector, modifier, callback);

The Teams doc gets updated even though the Leagues doc isn’t updated (or at least the draftHistory field in $push).

I noticed similar issues in the mongodb c# client which initially was causing unexpected behavior in an app. Very strange behavior because i had assumed a call to insert in my case only returns after a successful round trip to the database.