-
Type: Task
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Component/s: None
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 } }
- depends on
-
MOTOR-19 Can't force Motor to send w=1 write concern
- Closed
-
PYTHON-644 Can't force PyMongo to send w=1 write concern
- Closed
-
JAVA-1955 Add the ability to distinguish between an explicit write concern of {w : 1} and an acknowledged write concern that means to use the server's default
- Closed
- is related to
-
SERVER-12465 write commands accept empty writeConcern document
- Closed
- related to
-
CXX-182 Add support for Write Concern (outside of GLE)
- Closed