db.hello()
db.hello()
New in version 5.0: (and 4.4.2, 4.2.10, 4.0.21, and 3.6.21)
Returns a document that describes the role of the返回一个文档,该文档描述mongod
instance.mongod
实例的角色。If the如果mongod
is a member of a replica set, then theisWritablePrimary
andsecondary
fields report if the instance is the primary or if it is a secondary member of the replica set.mongod
是副本集的成员,则isWritablePrimary
和secondary
字段会报告该实例是副本集中的primary还是secondary。TipSee:参阅:hello
for the complete documentation of the output of用于获取db.hello()
.db.hello()
输出的完整文档。