-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
"""
I know how to use db.command(cmd) for commands like 'dbstats' from
within Pymongo but how can I call e.g. printReplicationInfo()
or the underlying getReplicationInfo()
"""
"""
Those are not commands but queries on the oplog, so you'd have to
implement some of that logic manually (unless we decide to support
them w/in pymongo, but not sure if that makes sense).
To view the source of getReplicationInfo type:
db.getReplicationInfo
in the shell (note no parens). You should be able to translate this to
python code w/ pymongo pretty easily.
"""
"""
I think it does make sense. There is actually no clean way to extract
replication related information w/o reimplementing the wheel on the
Python level. The output of 'serverStatus' can be accessed as JSON
through a db.command() call and such function calls could be wrapped in
a similar way.
"""