|
According the the documentation, a driver should not send any arguments along with GLE (or to the new write commands) unless the user has specified some.
The server interprets a no-arg GLE (or empty document write concern for the new write commands) as an indication to use the server's defaults. If a driver sends
{w:1}
as the "default", then it is always overriding the server's getLastErrorDefaults.
In practice, this is likely not a big deal as a high majority of users don't even know that getLastErrorDefaults exist and, of the ones that do, most wouldn't be changing it. As such, this is a low priority.
Examples:
- mongodb://localhost
- GLE: { getLastError: 1}
- Write Commands: don't include a writeConcern in the command.
- mongodb://localhost?w=0
- GLE: don't send one
- Write Commands: { writeConcern : { w: 0 } }. In addition, the driver is responsible for not blocking while waiting on the result.
- mongodb://localhost?w=1
- GLE: { getLastError: 1, w: 1 }
- Write Commands: { writeConcern: { w: 1 } }
- mongodb://localhost?journal=true
- GLE: { getLastError : 1, j: true }
- Write Commands: { writeConcern : { j : true } }
|