hello() – Return the state of the replica set command

Returns a document that reports the state of the replica set.

Syntax diagram

Read syntax diagramSkip visual syntax diagramdb.hello()

Command parameters

None or, optionally, a JSON query to get specific collection information.

Output

Values for the following properties are returned:
maxBsonObjectSize
Maximum BSON object size.
maxRowSize
Maximum number of bytes allowed for a row.
readOnly
Returns whether database is in read-only mode.
localTime
Current date and time.
maxBinaryLiteralLength
Maximum number of hex characters allowed in an inline binary literal.
maxCatalogNameLength
Maximum number of characters allowed in a catalog name.
maxCharLiteralLength
Maximum number of characters allowed for a character literal.
maxColumnNameLength
Maximum number of characters allowed for a column name.
maxIndexLength
Maximum number of bytes allows for an index, including all of the parts of the index.
maxCursorNameLength
Maximum number of characters allowed in a cursor name.
maxSchemaNameLength
Maximum number of characters allowed in a schema name.
maxProcedureNameLength
Maximum number of characters allowed in a procedure name.
maxTableNameLength
Maximum number of characters allowed for a table name.
maxUserNameLength
Maximum number of characters allowed for a user name.

Examples

The following example shows the command syntax for returning a report of the state of the replica set:
db.hello()
The following example shows the syntax of values returned from running the hello command:
{																		
		"maxBsonObjectSize" : 16777216									
		"maxRowSize" : 32677												
		"readOnly" : false												
		"localTime" : Fri Aug 09 14:42:21 IST 2024					
		"maxBinaryLiteralLength" : 4000									
		"maxCatalogNameLength" : 8										
		"maxCharLiteralLength" : 32672									
		"maxColumnNameLength" : 128										
		"maxIndexLength" : 1024											
		"maxCursorNameLength" : 128										
		"maxSchemaNameLength" : 128										
		"maxProcedureNameLength" : 128									
		"maxTableNameLength" : 128										
		"maxUserNameLength" : 30											
	}