Docs HomeMongoDB Manual

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 the isWritablePrimary and secondary fields report if the instance is the primary or if it is a secondary member of the replica set.如果mongod副本集的成员,则isWritablePrimarysecondary字段会报告该实例是副本集中的primary还是secondary

Tip

See: 参阅:

hello for the complete documentation of the output of db.hello().用于获取db.hello()输出的完整文档。