Home > database >  Mongo extract hostname field db.hostinfo
Mongo extract hostname field db.hostinfo

Time:10-30

I'm new to Mongo.

I can run db.hostInfo(), and it outputs lots of information, but I just want to see the "system"."hostname" field.

How do i do that ?

Thanks

CodePudding user response:

use

db.hostInfo().system.hostname

CodePudding user response:

Type and hit enter =>

db.hostInfo().system.hostname

This command works on Linux(Ubuntu20.04) and Win10.

  • Related