Major - P3
DRIVERS-144, we omit nModified when doing Collection.update() against a legacy server.
DRIVERS-143, we omit nModified when executing the Bulk API against a legacy server.
In this ticket, we sometimes omit nModified when executing the Bulk API against mongos 2.6 in a mixed-version cluster.
SERVER-13001, when a client executes an "update" command on a 2.6 mongos, and mongos executes it against some 2.4 mongods, mongos omits nModified from the response, or sets nModified to NULL. (We don't yet know which.)
If the client does a series of "update" commands within the same bulk operation against the same mongos, some responses could include nModified and some won't, depending on which mongods the mongos sent the operation to.
mongos follows this principle: nModified is 0 if you know it's 0. It's N if you know it's N. It's omitted or NULL if you don't know its true value. Drivers must follow this principle too.
The driver algorithm for merging results, when using write commands, follows in pseudocode:
If you're merging results from the Bulk API when using legacy ops, of course, nModified is already omitted according to
If you like, you can wait until
SERVER-13001 is complete and we know whether mongos sets nModified to NULL or omits it.
This is going to require an additional QA ticket for all drivers.