Details
-
Improvement
-
Resolution: Done
-
Minor - P4
-
None
-
None
Description
The settings.getLastErrorDefaults example on the Write Concern page says:
cfg = rs.conf()
|
cfg.settings.getLastErrorDefaults = {w: "majority", j: true}
|
rs.reconfig(cfg)
|
This only works if there is a settings field in the cfg document already. Otherwise, the shell complains with an error:
bla:PRIMARY> cfg = rs.conf()
|
{
|
"_id" : "bla",
|
"version" : 3,
|
"members" : [
|
{
|
"_id" : 0,
|
"host" : "capslock.local:27017"
|
},
|
{
|
"_id" : 1,
|
"host" : "capslock.local:27018"
|
},
|
{
|
"_id" : 2,
|
"host" : "capslock.local:27019"
|
}
|
]
|
}
|
bla:PRIMARY> cfg.settings.getLastErrorDefaults = {w: "majority", j: true}
|
Mon Oct 22 11:46:51 TypeError: cfg.settings has no properties (shell):1
|